webpack.config.js 504 B

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