webpack.config.dev.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. module.exports = merge(baseConfig, {
  7. mode: 'development',
  8. module: {
  9. rules: [
  10. {
  11. test: /\.css$/,
  12. use: [
  13. {
  14. loader: MiniCssExtractPlugin.loader,
  15. options: {
  16. publicPath: '',
  17. },
  18. },
  19. 'css-loader'
  20. ]
  21. }, {
  22. test: /\.scss$/,
  23. use: [
  24. {
  25. loader: MiniCssExtractPlugin.loader,
  26. options: {
  27. publicPath: '',
  28. },
  29. },
  30. 'css-loader',
  31. 'sass-loader'
  32. ]
  33. }, {
  34. test: /\.(png|jpg|gif|svg)$/,
  35. use: [
  36. {
  37. loader: 'url-loader',
  38. options: {
  39. limit: 5000
  40. }
  41. }
  42. ]
  43. }
  44. ]
  45. },
  46. plugins: [
  47. // new webpack.HotModuleReplacementPlugin()
  48. ]
  49. })