webpack.config.js 504 B

1234567891011121314151617181920212223
  1. var webpack = require('webpack');
  2. module.exports = {
  3. entry: './index.js',
  4. module: {
  5. loaders: [
  6. { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader?presets[]=es2015&presets[]=react' }
  7. ]
  8. },
  9. output: {
  10. filename: 'bundle.js',
  11. path: 'public',
  12. publicPath: ''
  13. },
  14. plugins: process.env.NODE_ENV === 'production' ? [
  15. new webpack.optimize.DedupePlugin(),
  16. new webpack.optimize.OccurenceOrderPlugin(),
  17. new webpack.optimize.UglifyJsPlugin()
  18. ] : []
  19. };