mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
23 lines
561 B
JavaScript
23 lines
561 B
JavaScript
import { setupWebpack, getWebpackConfig } from './webpack.js';
|
|
import { reloadByondCache } from './reloader.js';
|
|
|
|
const noHot = process.argv.includes('--no-hot');
|
|
const reloadOnce = process.argv.includes('--reload');
|
|
|
|
const setupServer = async () => {
|
|
const config = await getWebpackConfig({
|
|
mode: 'development',
|
|
hot: !noHot,
|
|
});
|
|
// Reload cache once
|
|
if (reloadOnce) {
|
|
const bundleDir = config.output.path;
|
|
await reloadByondCache(bundleDir);
|
|
return;
|
|
}
|
|
// Run a development server
|
|
await setupWebpack(config);
|
|
};
|
|
|
|
setupServer();
|