Files
KaTeX/webpack.dev.js
Erik Demaine e7d38df8d4 chore(deps): update webpack, webpack-cli, webpack-dev-server (#3191)
* chore(deps): update webpack, webpack-cli, webpack-dev-server

Fixes #3189

* injectClient -> client

* Switch WebpackDevServer constructor order

* Switch from listen to start

* Fix missing argument to catch

* chore: dedupe lockfile

* chore: update to Yarn 3.0.1

* ci: run yarn install on semantic release

* ci: use setup-node cache

* chore: update lockfile

Co-authored-by: Ylemkimon <y@ylem.kim>
2021-08-27 13:04:13 +09:00

34 lines
1.0 KiB
JavaScript

// @flow
const {targets, createConfig} = require('./webpack.common');
const path = require('path');
const PORT = 7936;
// dev minify
const katexConfig /*: Object*/ = createConfig(targets.shift(), true, false);
// add the entry point for test page
katexConfig.entry.main = './static/main.js';
// only the `devServer` options for the first configuration will be taken
// into account and used for all the configurations in the array.
katexConfig.devServer = {
static: [
path.join(__dirname, 'static'),
{
directory: __dirname,
watch: false,
},
],
// Allow server to be accessed from anywhere, which is useful for
// testing. This potentially reveals the source code to the world,
// but this should not be a concern for testing open-source software.
allowedHosts: 'all',
host: '0.0.0.0',
port: PORT,
};
module.exports = ([
katexConfig,
...targets.map(target => createConfig(target, true, false)),
] /*: Array<Object> */);