Files
KaTeX/webpack.dev.js
ylemkimon 58c4c7c4a4 Set webpack-dev-server host to 0.0.0.0 (#1122)
webpack-dev-server CLI has a default value of localhost, which only
allows accessing locally. Setting to 0.0.0.0 allows to access the server
from the external. However, the open option will open 0.0.0.0:7936,
which is an invalid address, so it has been removed.
2018-01-31 19:00:40 -05:00

27 lines
908 B
JavaScript

// @flow
const { targets, createConfig } = require('./webpack.common');
const path = require('path');
const PORT = 7936;
// only the `devServer` options for the first configuration will be taken
// into account and used for all the configurations in the array.
// dev minify
const katexConfig = createConfig(targets.shift(), true, false);
katexConfig.devServer = {
contentBase: [path.join(__dirname, 'static'), __dirname],
// 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.
disableHostCheck: true,
host: '0.0.0.0',
port: PORT,
stats: {
colors: true,
},
};
module.exports = [
katexConfig,
...targets.map(target => createConfig(target, true, false)),
];