fix: remove first umijs in prod html

main
jialin 2 years ago
parent 9c9b35ff9b
commit 50104cf276

@ -19,9 +19,6 @@ export default defineConfig({
history: {
type: 'hash'
},
// https: {
// http2: true
// },
base: process.env.npm_config_base || '/',
...(isProduction
? {

@ -1,38 +0,0 @@
// @ts-nocheck
const fs = require('fs');
const path = require('path');
class DeleteCssPlugin {
constructor(options) {
this.options = options || {};
}
apply(compiler) {
compiler.hooks.done.tap('DeleteCssPlugin', (stats) => {
const outputPath =
this.options.outputPath || path.resolve(__dirname, 'dist');
fs.readdir(outputPath, (err, files) => {
if (err) {
console.error(`Failed to read directory: ${outputPath}`, err);
return;
}
files.forEach((file) => {
if (file.endsWith('.css')) {
const filePath = path.join(outputPath, file);
fs.unlink(filePath, (err) => {
if (err) {
console.error(`Failed to delete file: ${filePath}`, err);
} else {
console.log(`Deleted: ${filePath}`);
}
});
}
});
});
});
}
}
module.exports = DeleteCssPlugin;

@ -10,6 +10,9 @@ export default (api: IApi) => {
? info.version || info.commitId
: `dev-${info.commitId}`
);
if (env === 'production') {
$('script[src^="/js/umi"]').first?.().remove?.();
}
return $;
});
api.onStart(() => {

@ -2,5 +2,5 @@ export default {
documentation: 'https://docs.gpustack.ai/',
github: 'https://github.com/gpustack/gpustack',
discord: 'https://discord.gg/VXYJzuaqwD',
site: 'https://seal.io/'
site: 'https://gpustack.ai/'
};

@ -19,6 +19,7 @@ export default {
'resources.table.total': 'Total',
'resources.table.used': 'Used',
'resources.table.wokers': 'workers',
'resources.worker.linuxormaxos': 'Linux or MacOS',
'resources.table.unified': 'Unified Memory',
'resources.worker.add.step1': 'Get Token',
'resources.worker.add.step2': 'Register Worker',

@ -20,6 +20,7 @@ export default {
'resources.table.used': '已用',
'resources.table.wokers': 'workers',
'resources.table.unified': '统一内存',
'resources.worker.linuxormaxos': 'Linux 或 MacOS',
'resources.worker.add.step1': '获取 Token',
'resources.worker.add.step2': '注册 Worker',
'resources.worker.add.step2.tips':

@ -15,7 +15,7 @@ const Models: React.FC = () => {
const { setChunkRequest } = useSetChunkRequest();
const { setChunkRequest: setModelInstanceChunkRequest } =
useSetChunkRequest();
const [total, setTotal] = useState(100);
const [total, setTotal] = useState(0);
const [modelInstances, setModelInstances] = useState<any[]>([]);
const [loading, setLoading] = useState(false);
const [dataSource, setDataSource] = useState<ListItem[]>([]);

@ -30,7 +30,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
>
<div>
<h3>1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}</h3>
<h4>Linux Or MacOS </h4>
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
<HighlightCode code={addWorkerGuide.mac.getToken}></HighlightCode>
<h4>Windows </h4>
<HighlightCode code={addWorkerGuide.win.getToken}></HighlightCode>
@ -46,7 +46,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
}}
></span>
</h3>
<h4>Linux Or MacOS </h4>
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
<HighlightCode
code={addWorkerGuide.mac.registerWorker(origin)}
></HighlightCode>

Loading…
Cancel
Save