mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
## About The Pull Request Swaps us back to RSPack. I keep getting pings about this #91925, which I can only guess is webpack related. That, and I don't want to just give up on rspack, I was merely frustrated with it while fixing bun builds. ## Why It's Good For The Game Less javascript. Puts us back on our last build tool. Might fix the html entity issue We can also run the config in ts which I think is sweet ## Changelog
32 lines
580 B
TypeScript
32 lines
580 B
TypeScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import fs from 'node:fs';
|
|
|
|
import { reloadByondCache } from './reloader';
|
|
import { RspackCompiler } from './webpack';
|
|
|
|
const reloadOnce = process.argv.includes('--reload');
|
|
|
|
async function setupServer() {
|
|
fs.mkdirSync('./public/.tmp', { recursive: true });
|
|
|
|
const compiler = new RspackCompiler();
|
|
|
|
await compiler.setup();
|
|
|
|
// Reload cache once
|
|
if (reloadOnce) {
|
|
await reloadByondCache(compiler.bundleDir);
|
|
return;
|
|
}
|
|
|
|
// Run a development server
|
|
await compiler.watch();
|
|
}
|
|
|
|
setupServer();
|