webpack.config.dev.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. 'use strict'
  2. const webpack = require('webpack')
  3. const merge = require('webpack-merge')
  4. const baseConfig = require('./webpack.config.base')
  5. const PORT = 8988
  6. module.exports = merge(baseConfig, {
  7. mode: 'development',
  8. output: {
  9. publicPath: '/'
  10. },
  11. devServer: {
  12. clientLogLevel: 'warning',
  13. historyApiFallback: {
  14. // rewrites: [
  15. // { from: /.*/, to: '/index.html' },
  16. // ],
  17. index: '/',
  18. disableDotRule: true,
  19. verbose: true
  20. },
  21. // historyApiFallback: true,
  22. hot: true,
  23. contentBase: 'dist',
  24. compress: true,
  25. // host: 'dev.gdp.fr',
  26. host: '0.0.0.0',
  27. port: PORT,
  28. disableHostCheck: true,
  29. overlay: { warnings: false, errors: true },
  30. publicPath: '/',
  31. quiet: false,
  32. // open: "firefox-developer-edition",
  33. },
  34. module: {
  35. rules: [
  36. {
  37. test: /\.css$/,
  38. use: [
  39. 'vue-style-loader',
  40. 'css-loader'
  41. ]
  42. }, {
  43. test: /\.scss$/,
  44. use: [
  45. 'vue-style-loader',
  46. 'css-loader',
  47. 'sass-loader'
  48. ]
  49. }
  50. ]
  51. },
  52. plugins: [
  53. new webpack.HotModuleReplacementPlugin(),
  54. new webpack.DefinePlugin({
  55. "process.env": "'dev'"
  56. })
  57. ]
  58. })