mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: upgrade to webpack5
This commit is contained in:
1 parent
8648929063
commit
a05125c6b0
134 files changed
+503
-457
No files matched your search
@@ -19,19 +19,17 @@ async function runWebpack({
|
||||
}) {
|
||||
const compiler = webpack(webpackConfig({ watch, production, measure }));
|
||||
if (dev) {
|
||||
const server = new WebpackDevServer(compiler, {
|
||||
const server = new WebpackDevServer({
|
||||
port: 8000,
|
||||
compress: true,
|
||||
hot: true,
|
||||
disableHostCheck: true,
|
||||
stats: 'none',
|
||||
index: root('public'),
|
||||
proxy: {
|
||||
context: (path) => !path.includes('sockjs-node'),
|
||||
context: (path) => path !== '/ws' && !path.startsWith('/vendors.js'),
|
||||
target: 'http://localhost:2333',
|
||||
ws: true,
|
||||
},
|
||||
});
|
||||
return server.listen(8000);
|
||||
}, compiler);
|
||||
return server.start();
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
function compilerCallback(err, stats) {
|
||||
@@ -85,15 +83,10 @@ async function main() {
|
||||
if (fs.existsSync('public/polyfill.js')) {
|
||||
fs.copyFileSync('public/polyfill.js', `public/polyfill-${pkg.version}.js`);
|
||||
}
|
||||
if (fs.existsSync('public/default.theme.css')) {
|
||||
fs.copyFileSync('public/default.theme.css', `public/default-${pkg.version}.theme.css`);
|
||||
}
|
||||
if (argv.options.production) {
|
||||
fs.removeSync('public/vditor/dist/js/mathjax');
|
||||
fs.removeSync('public/vditor/dist/js/echarts');
|
||||
fs.removeSync('public/vditor/dist/js/graphviz');
|
||||
fs.removeSync('public/vditor/dist/js/mermaid');
|
||||
fs.removeSync('public/vditor/dist/js/abcjs');
|
||||
const files = fs.readdirSync('public');
|
||||
files.filter((i) => /(^[in]\..+|worker)\.js\.map$/.test(i)).forEach((i) => fs.removeSync(`public/${i}`));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user