This commit is contained in:
Chompstation Bot
2021-06-18 04:23:03 +00:00
committed by Darlantan
parent 5f76f2e855
commit 331e5230d6
332 changed files with 23458 additions and 9666 deletions

View File

@@ -1,22 +1,30 @@
import { setupWebpack, getWebpackConfig } from './webpack.js';
/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
*/
import { createCompiler } from './webpack.js';
import { reloadByondCache } from './reloader.js';
const noHot = process.argv.includes('--no-hot');
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,
useTmpFolder: !noTmp,
});
// 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();