webpack.config.dev.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. test: /\.(png|jpg|gif)$/,
  31. use: [
  32. {
  33. loader: 'url-loader',
  34. options: {
  35. limit: 5000
  36. }
  37. }
  38. ]
  39. }
  40. ]
  41. },
  42. plugins: [
  43. // new webpack.HotModuleReplacementPlugin()
  44. ]
  45. })