Files
Bubberstation/tgui/packages/tgui-dev-server/index.js
SkyratBot 7f9be2ba6b [MIRROR] Fixes tgui dev server [NO GBP] [MDB IGNORE] (#25226)
* Fixes tgui dev server [NO GBP] (#79898)

## About The Pull Request
- the .js extensions were required, this is my fault.
- fixes a crash "automatic publicPath is not supported in this browser"
## Why It's Good For The Game
Bug fixes. Dev server is working
## Changelog
N/A nothing player facing

* Fixes tgui dev server [NO GBP]

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2023-11-23 21:55:36 -05:00

31 lines
673 B
JavaScript

/**
* @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 compiler = await createCompiler({
mode: 'development',
hot: !noHot,
devServer: true,
useTmpFolder: !noTmp,
});
// Reload cache once
if (reloadOnce) {
await reloadByondCache(compiler.bundleDir);
return;
}
// Run a development server
await compiler.watch();
};
setupServer();