development.js 806 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const HtmlWebpackPlugin = require('html-webpack-plugin');
  2. const paths = require('../utils/paths');
  3. module.exports = env => ({
  4. devtool: 'cheap-eval-source-map',
  5. output: {
  6. filename: '[name].js',
  7. },
  8. module: {
  9. rules: [
  10. {
  11. test: /\.css$/,
  12. use: ['style-loader', 'css-loader', 'postcss-loader'],
  13. },
  14. {
  15. test: /\.scss$/,
  16. use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
  17. },
  18. ],
  19. },
  20. plugins: [
  21. new HtmlWebpackPlugin({
  22. template: './index.html',
  23. }),
  24. ],
  25. devServer: {
  26. contentBase: paths.BUILD_DIR,
  27. publicPath: '',
  28. historyApiFallback: true,
  29. compress: true,
  30. port: 4042,
  31. noInfo: true,
  32. quiet: true,
  33. clientLogLevel: 'warning',
  34. stats: 'errors-only',
  35. open: true,
  36. },
  37. });