building pipeline

This commit is contained in:
Letter N
2021-03-04 21:51:20 +08:00
parent 23c04cac12
commit dcab40cdb6
134 changed files with 10776 additions and 5991 deletions
+4 -5
View File
@@ -4,7 +4,7 @@
* @license MIT
*/
import { setupWebpack, getWebpackConfig } from './webpack.js';
import { createCompiler } from './webpack.js';
import { reloadByondCache } from './reloader.js';
const noHot = process.argv.includes('--no-hot');
@@ -12,7 +12,7 @@ const noTmp = process.argv.includes('--no-tmp');
const reloadOnce = process.argv.includes('--reload');
const setupServer = async () => {
const config = await getWebpackConfig({
const compiler = await createCompiler({
mode: 'development',
hot: !noHot,
devServer: true,
@@ -20,12 +20,11 @@ const setupServer = async () => {
});
// Reload cache once
if (reloadOnce) {
const bundleDir = config.output.path;
await reloadByondCache(bundleDir);
await reloadByondCache(compiler.bundleDir);
return;
}
// Run a development server
await setupWebpack(config);
await compiler.watch();
};
setupServer();