ui: add polyfill

This commit is contained in:
undefined committed 2024-06-27 15:40:21 +08:00
1 parent 2a8e3142b3
commit 67307ca48d
7 files changed
+48 -39

No files matched your search

+1 -9
View File
@@ -19,7 +19,7 @@ const argv = cac().parse();
async function runWebpack({
watch, production, measure, dev, https,
}) {
const compiler = webpack(webpackConfig({ watch, production, measure }));
const compiler = webpack(await webpackConfig({ watch, production, measure }));
if (dev) {
const server = new WebpackDevServer({
port: https ? 8001 : 8000,
@@ -124,12 +124,6 @@ async function main() {
if (argv.options.gulp) await runGulp();
else {
await runWebpack(argv.options as any);
if (fs.existsSync('public/hydro.js')) {
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
}
if (fs.existsSync('public/polyfill.js')) {
fs.copyFileSync('public/polyfill.js', `public/polyfill-${pkg.version}.js`);
}
if (fs.existsSync('public/theme.css')) {
fs.copyFileSync('public/theme.css', `public/theme-${pkg.version}.css`);
}
@@ -137,8 +131,6 @@ async function main() {
for (const f of ['echarts', 'graphviz', 'mermaid', 'mathjax']) {
fs.removeSync(`public/vditor/dist/js/${f}`);
}
const files = fs.readdirSync('public');
files.filter((i) => /(^[in]\..+|worker)\.js\.map$/.test(i)).forEach((i) => fs.removeSync(`public/${i}`));
}
await Promise.all(globbySync('public/**/*.map').map((i) => fs.remove(i)));
}