webpack.dev.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const path = require("path");
  2. const webpack = require("webpack");
  3. const merge = require("webpack-merge");
  4. const baseWpConfig = require("./webpack.base.config");
  5. baseWpConfig.entry.unshift("webpack-hot-middleware/client");
  6. const HtmlWebpackPlugin = require('html-webpack-plugin');
  7. const publicDir = path.resolve(__dirname, '../server/public');
  8. const clientDir = path.resolve(__dirname, '../client');
  9. module.exports = merge(baseWpConfig, {
  10. mode: 'development',
  11. devtool: "#inline-source-map",
  12. output: {
  13. path: `${publicDir}/app`,
  14. filename: 'bundle.js'
  15. },
  16. module: {
  17. rules: [
  18. {
  19. test: /\.css$/,
  20. use: [
  21. 'vue-style-loader',
  22. 'css-loader'
  23. ]
  24. },
  25. ]
  26. },
  27. plugins: [
  28. new webpack.HotModuleReplacementPlugin(),
  29. new webpack.NoEmitOnErrorsPlugin(),
  30. new HtmlWebpackPlugin({
  31. template: `${clientDir}/index.html.template`,
  32. filename: `${publicDir}/index.html`
  33. })
  34. ]
  35. });