Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

webpack.dev.conf.js 1.2 KiB

1234567891011121314151617181920212223242526272829303132333435
  1. var utils = require('./utils')
  2. var webpack = require('webpack')
  3. var config = require('../config')
  4. var merge = require('webpack-merge')
  5. var baseWebpackConfig = require('./webpack.base.conf')
  6. var HtmlWebpackPlugin = require('html-webpack-plugin')
  7. var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
  8. // add hot-reload related code to entry chunks
  9. Object.keys(baseWebpackConfig.entry).forEach(function (name) {
  10. baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
  11. })
  12. module.exports = merge(baseWebpackConfig, {
  13. module: {
  14. rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
  15. },
  16. // cheap-module-eval-source-map is faster for development
  17. devtool: '#cheap-module-eval-source-map',
  18. plugins: [
  19. new webpack.DefinePlugin({
  20. 'process.env': config.dev.env
  21. }),
  22. // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
  23. new webpack.HotModuleReplacementPlugin(),
  24. new webpack.NoEmitOnErrorsPlugin(),
  25. // https://github.com/ampedandwired/html-webpack-plugin
  26. new HtmlWebpackPlugin({
  27. filename: 'index.html',
  28. template: 'index.html',
  29. inject: true
  30. }),
  31. new FriendlyErrorsPlugin()
  32. ]
  33. })