Guest User

Untitled

a guest
Nov 23rd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. const webpack = require('webpack');
  2. const nodeEnv = process.env.NODE_ENV || 'production';
  3.  
  4. module.exports = {
  5. devtool: 'source-map',
  6. entry: {
  7. filename: './index.js'
  8. },
  9. output: {
  10. filename: '_build/bundle.js'
  11. },
  12. module: {
  13. loaders: [
  14. {
  15. test: /\.js$/,
  16. exclude: /node_modules/,
  17. loader: 'babel-loader',
  18. query: {
  19. presets: ['es2015-native-modules']
  20. }
  21. }
  22. ]
  23. },
  24. plugins: [
  25. new webpack.optimize.UglifyJsPlugin({
  26. compress: {
  27. warnings: false
  28. },
  29. output: {
  30. comments: false
  31. },
  32. sourceMap: true
  33. }),
  34. new webpack.DefinePlugin({
  35. 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) }
  36. })
  37. ]
  38. };
Add Comment
Please, Sign In to add comment