ui: fix polyfill link generation

This commit is contained in:
undefined committed 2022-03-15 10:37:34 +08:00
1 parent c6485c536e
commit 545190d5fe
3 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -54,7 +54,7 @@ async function runWebpack({
} }
if (argv.options.detail) console.log(stats.toString()); if (argv.options.detail) console.log(stats.toString());
if (!watch && (!stats || stats.hasErrors())) process.exitCode = 1; if (!watch && (!stats || stats.hasErrors())) process.exitCode = 1;
resolve(); resolve(null);
} }
if (watch) compiler.watch({}, compilerCallback); if (watch) compiler.watch({}, compilerCallback);
else compiler.run(compilerCallback); else compiler.run(compilerCallback);
@@ -77,7 +77,7 @@ async function runGulp() {
gulp.on('stop', ({ uid, name }) => { gulp.on('stop', ({ uid, name }) => {
log(chalk.green('Finished: %s'), chalk.reset(name)); log(chalk.green('Finished: %s'), chalk.reset(name));
taskList[uid] = false; 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(); gulpTasks.default();
}); });
@@ -87,7 +87,7 @@ async function main() {
const dir = process.cwd(); const dir = process.cwd();
process.chdir(root()); process.chdir(root());
await runGulp(); await runGulp();
await runWebpack(argv.options); await runWebpack(argv.options as any);
if (fs.existsSync('public/hydro.js')) { if (fs.existsSync('public/hydro.js')) {
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`); fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.34.4", "version": "4.34.5",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
@@ -46,7 +46,7 @@
} catch(e) { } catch(e) {
const s = document.createElement('script'); const s = document.createElement('script');
s.async = false; 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); document.head.appendChild(s);
} }
</script> </script>