forked from reactjs/react-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
34 lines (33 loc) · 980 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var webpack = require("webpack");
var isDev = process.argv.indexOf('--dev') > -1;
module.exports = {
entry: "./components/browser.js",
output: {
path: "./public/scripts",
filename: "bundle.js"
},
// These libraries are included in separate script tags and are available as global variables
externals: {
"react": "React",
"marked": "marked",
"jquery": "jQuery",
"react-dom": "ReactDOM",
"window": "window"
},
plugins: isDev ?
[] :
[new webpack.optimize.UglifyJsPlugin({minimize: true})],
devtool: isDev ? 'source-map' : null,
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: {
presets: ['react', 'es2015']
}
}
]
}
};