webpack.config.dev.js 883 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. // 'vue-style-loader',
  17. 'css-loader'
  18. ]
  19. }, {
  20. test: /\.scss$/,
  21. use: [
  22. process.env.NODE_ENV !== 'production'
  23. ? 'vue-style-loader'
  24. : MiniCssExtractPlugin.loader,
  25. // 'vue-style-loader',
  26. 'css-loader',
  27. 'sass-loader'
  28. ]
  29. }
  30. ]
  31. },
  32. plugins: [
  33. // new webpack.HotModuleReplacementPlugin()
  34. ]
  35. })