mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
TGUI 4.3
This commit is contained in:
committed by
Darlantan
parent
5f76f2e855
commit
331e5230d6
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user