-
-
Save xuyuji9000/40f8557069e085bdb2b5611983b6d96d to your computer and use it in GitHub Desktop.
Sample Basic Webpack Config
This file contains 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
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" | |
}, | |
plugins: debug ? [] : [ | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), | |
], | |
module: { | |
loaders: [{ | |
test: /.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment