webpack.config.dev.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const merge = require('webpack-merge')
  2. const MiniCssExtractPlugin = require('mini-css-extract-plugin')
  3. const base = require('./webpack.config')
  4. module.exports = merge(base, {
  5. mode: 'development',
  6. // Enable source maps for dev (fast compilation, slow runtime)
  7. devtool: 'cheap-module-eval-source-map',
  8. plugins: [
  9. // Extract CSS to a separate file (rather than inlining to a <style> tag)
  10. new MiniCssExtractPlugin({
  11. // Output to public/stylesheets directory
  12. filename: 'stylesheets/[name].css'
  13. })
  14. ],
  15. devServer: {
  16. // Disable webpack dev server auto-reload
  17. inline: false,
  18. // Expose dev server as localhost with dev box
  19. host: '0.0.0.0',
  20. port: 3808,
  21. // Customise output to the (node) console
  22. stats: {
  23. colors: true, // Enable some coloured highlighting
  24. // Hide some overly verbose output
  25. performance: false, // Disable as code is uncompressed in dev mode
  26. hash: false,
  27. version: false,
  28. chunks: false,
  29. modules: false,
  30. // Hide copied assets from output
  31. excludeAssets: [/^js\/ace/, /^js\/libs/, /^js\/cmaps/]
  32. }
  33. }
  34. })