Created
January 27, 2017 05:01
-
-
Save Jezfx/00c0d2ed5abb539144ff39d661bb4d3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const webpack = require('webpack'); | |
| const nodeEnv = process.env.NODE_ENV || 'production'; | |
| module.exports = { | |
| devtool: 'source-map', | |
| entry: { | |
| filename: './app.js' | |
| }, | |
| output: { | |
| filename: '_build/bundle.js' | |
| }, | |
| module: { | |
| loaders: [ | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, | |
| loader: 'babel', | |
| query: { | |
| presets: ['es2015-native-modules'] | |
| } | |
| } | |
| ] | |
| }, | |
| plugins: [ | |
| new webpack.optimize.UglifyJsPlugin({ | |
| compress: { | |
| warnings: false | |
| }, | |
| output: { | |
| comments: false | |
| }, | |
| sourceMap: true | |
| }), | |
| new webpack.DefinePlugin({ | |
| 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } | |
| }) | |
| ] | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment