跳板机管理web端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

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