ui: fix polyfill link generation

pull/318/head
undefined 3 years ago
parent c6485c536e
commit 545190d5fe

@ -54,7 +54,7 @@ async function runWebpack({
}
if (argv.options.detail) console.log(stats.toString());
if (!watch && (!stats || stats.hasErrors())) process.exitCode = 1;
resolve();
resolve(null);
}
if (watch) compiler.watch({}, compilerCallback);
else compiler.run(compilerCallback);
@ -77,7 +77,7 @@ async function runGulp() {
gulp.on('stop', ({ uid, name }) => {
log(chalk.green('Finished: %s'), chalk.reset(name));
taskList[uid] = false;
if (Object.values(taskList).filter((b) => b).length === 0) resolve();
if (Object.values(taskList).filter((b) => b).length === 0) resolve(null);
});
gulpTasks.default();
});
@ -87,7 +87,7 @@ async function main() {
const dir = process.cwd();
process.chdir(root());
await runGulp();
await runWebpack(argv.options);
await runWebpack(argv.options as any);
if (fs.existsSync('public/hydro.js')) {
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
}

@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.34.4",
"version": "4.34.5",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",

@ -46,7 +46,7 @@
} catch(e) {
const s = document.createElement('script');
s.async = false;
s.src = "{{ '/polyfill.js' if process.env.DEV else static_url(global.Hydro.version['ui-default'] + '.polyfill.js') }}";
s.src = "{{ '/polyfill.js' if process.env.DEV else static_url('polyfill-' + global.Hydro.version['ui-default'] + '.js') }}";
document.head.appendChild(s);
}
</script>

Loading…
Cancel
Save