webpack.config.dev.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. // process.env.NODE_ENV !== 'production'
  14. // ? 'vue-style-loader'
  15. // : MiniCssExtractPlugin.loader,
  16. MiniCssExtractPlugin.loader,
  17. // 'vue-style-loader',
  18. 'css-loader'
  19. ]
  20. }, {
  21. test: /\.scss$/,
  22. use: [
  23. // process.env.NODE_ENV !== 'production'
  24. // ? 'vue-style-loader'
  25. // : MiniCssExtractPlugin.loader,
  26. MiniCssExtractPlugin.loader,
  27. // 'vue-style-loader',
  28. 'css-loader',
  29. 'sass-loader'
  30. ]
  31. }, {
  32. test: /\.(png|jpg|gif)$/,
  33. use: [
  34. {
  35. loader: 'url-loader',
  36. options: {
  37. limit: 5000
  38. }
  39. }
  40. ]
  41. }
  42. ]
  43. },
  44. plugins: [
  45. // new webpack.HotModuleReplacementPlugin()
  46. ]
  47. })