webpack.config.dev.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const webpack = require('webpack')
  2. const merge = require('webpack-merge')
  3. const MiniCssExtractPlugin = require('mini-css-extract-plugin')
  4. const base = require('./webpack.config')
  5. module.exports = merge(base, {
  6. mode: 'development',
  7. // Enable accurate source maps for dev
  8. devtool: 'source-map',
  9. plugins: [
  10. // Extract CSS to a separate file (rather than inlining to a <style> tag)
  11. new MiniCssExtractPlugin({
  12. // Output to public/stylesheets directory
  13. filename: 'stylesheets/[name].css',
  14. }),
  15. // Disable React DevTools if DISABLE_REACT_DEVTOOLS is set to "true"
  16. new webpack.DefinePlugin({
  17. __REACT_DEVTOOLS_GLOBAL_HOOK__:
  18. process.env.DISABLE_REACT_DEVTOOLS === 'true'
  19. ? '({ isDisabled: true })'
  20. : undefined,
  21. }),
  22. ],
  23. devServer: {
  24. // Expose dev server at www.dev-overleaf.com
  25. host: '0.0.0.0',
  26. port: 3808,
  27. public: 'www.dev-overleaf.com:443',
  28. // Customise output to the (node) console
  29. stats: {
  30. colors: true, // Enable some coloured highlighting
  31. // Hide some overly verbose output
  32. performance: false, // Disable as code is uncompressed in dev mode
  33. hash: false,
  34. version: false,
  35. chunks: false,
  36. modules: false,
  37. // Hide copied assets from output
  38. excludeAssets: [/^js\/ace/, /^js\/libs/, /^js\/cmaps/],
  39. },
  40. },
  41. })