webpack.dev.js 990 B

12345678910111213141516171819202122232425262728293031
  1. // @flow
  2. const {targets, createConfig} = require('./webpack.common');
  3. const path = require('path');
  4. const PORT = 7936;
  5. // dev minify
  6. const katexConfig = createConfig(targets.shift(), true, false);
  7. // add the entry point for test page
  8. katexConfig.entry.main = './static/main.js';
  9. // only the `devServer` options for the first configuration will be taken
  10. // into account and used for all the configurations in the array.
  11. katexConfig.devServer = {
  12. contentBase: [path.join(__dirname, 'static'), __dirname],
  13. // Allow server to be accessed from anywhere, which is useful for
  14. // testing. This potentially reveals the source code to the world,
  15. // but this should not be a concern for testing open-source software.
  16. disableHostCheck: true,
  17. host: '0.0.0.0',
  18. port: PORT,
  19. stats: {
  20. colors: true,
  21. },
  22. };
  23. module.exports = [
  24. katexConfig,
  25. ...targets.map(target => createConfig(target, true, false)),
  26. ];