development.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Note: You must restart bin/webpack-dev-server for changes to take effect
  2. const merge = require('webpack-merge');
  3. const sharedConfig = require('./shared');
  4. const { settings, output } = require('./configuration');
  5. const watchOptions = {};
  6. if (process.env.VAGRANT) {
  7. // If we are in Vagrant, we can't rely on inotify to update us with changed
  8. // files, so we must poll instead. Here, we poll every second to see if
  9. // anything has changed.
  10. watchOptions.poll = 1000;
  11. }
  12. module.exports = merge(sharedConfig, {
  13. mode: 'development',
  14. cache: true,
  15. devtool: 'cheap-module-eval-source-map',
  16. stats: {
  17. errorDetails: true,
  18. },
  19. output: {
  20. pathinfo: true,
  21. },
  22. devServer: {
  23. clientLogLevel: 'none',
  24. compress: settings.dev_server.compress,
  25. quiet: settings.dev_server.quiet,
  26. disableHostCheck: settings.dev_server.disable_host_check,
  27. host: settings.dev_server.host,
  28. port: settings.dev_server.port,
  29. https: settings.dev_server.https,
  30. hot: settings.dev_server.hmr,
  31. contentBase: output.path,
  32. inline: settings.dev_server.inline,
  33. useLocalIp: settings.dev_server.use_local_ip,
  34. public: settings.dev_server.public,
  35. publicPath: output.publicPath,
  36. historyApiFallback: {
  37. disableDotRule: true,
  38. },
  39. headers: settings.dev_server.headers,
  40. overlay: settings.dev_server.overlay,
  41. stats: {
  42. entrypoints: false,
  43. errorDetails: false,
  44. modules: false,
  45. moduleTrace: false,
  46. },
  47. watchOptions: Object.assign(
  48. {},
  49. settings.dev_server.watch_options,
  50. watchOptions
  51. ),
  52. },
  53. });