webpack.config.dev.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use strict'
  2. const webpack = require('webpack')
  3. const { merge } = require('webpack-merge')
  4. const baseConfig = require('./webpack.config.base')
  5. const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  6. const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
  7. module.exports = merge(baseConfig, {
  8. mode: 'development',
  9. module: {
  10. rules: [
  11. {
  12. test: /\.css$/,
  13. use: [
  14. {
  15. loader: MiniCssExtractPlugin.loader,
  16. options: {
  17. publicPath: '',
  18. },
  19. },
  20. 'css-loader'
  21. ]
  22. }, {
  23. test: /\.scss$/,
  24. use: [
  25. {
  26. loader: MiniCssExtractPlugin.loader,
  27. options: {
  28. publicPath: '',
  29. },
  30. },
  31. 'css-loader',
  32. 'sass-loader'
  33. ]
  34. }, {
  35. test: /\.(png|jpg|gif|svg)$/,
  36. use: [
  37. {
  38. loader: 'url-loader',
  39. options: {
  40. limit: 5000
  41. }
  42. }
  43. ]
  44. }
  45. ]
  46. },
  47. plugins: [
  48. // new webpack.HotModuleReplacementPlugin()
  49. new BundleAnalyzerPlugin({
  50. 'analyzerMode': 'static'
  51. })
  52. ]
  53. })