Files
Bubberstation/tgui/packages/tgui-dev-server/index.js
Jeremiah 6ccb751678 Updates eslint + sorts imports (#80430)
## About The Pull Request
General maintenance for eslint + adds an autofix for import sorting

If you're a reviewer/downstream, don't worry s'much about the file diff,
these are automated changes. To port this is pretty simple:
- `cd tgui`
- Update other packages (optional)
- `yarn add eslint-plugin-simple-import-sort`
- Add linter rules: eslintrc.yml
[guide](https://github.com/lydell/eslint-plugin-simple-import-sort?tab=readme-ov-file#usage)
&& file format rules to eslintignore
- `yarn eslint packages --fix`

Done!

## Why It's Good For The Game
Dev exp ++
## Changelog
N/A nothing player facing
2023-12-18 13:15:59 -08:00

31 lines
673 B
JavaScript

/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
*/
import { reloadByondCache } from './reloader.js';
import { createCompiler } from './webpack.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();