1
0

webpack-base.config.js 605 B

1234567891011121314151617181920212223242526
  1. var webpack = require('webpack');
  2. module.exports = function(production) {
  3. var plugins = [];
  4. if(production) {
  5. plugins.push(
  6. new webpack.optimize.UglifyJsPlugin(),
  7. new webpack.DefinePlugin({
  8. "process.env": {
  9. NODE_ENV: JSON.stringify("production")
  10. }
  11. })
  12. );
  13. }
  14. return {
  15. entry: './assets/index',
  16. output: {
  17. path: 'public',
  18. publicPath: '/assets/',
  19. filename: 'bundle.js'
  20. },
  21. devtool: 'eval',
  22. plugins: plugins
  23. }
  24. };