Created
October 5, 2016 01:58
-
-
Save dengjonathan/3d4b8d48a1436c375183cd9680edd8d7 to your computer and use it in GitHub Desktop.
Webpack Dev Server Config for ES6/ React
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
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
devtool: 'source-map', | |
entry: [ | |
'./app/index.js' | |
], | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: 'bundle.js', | |
publicPath: '/dist/' | |
}, | |
plugins: [ | |
new webpack.optimize.UglifyJsPlugin({ | |
minimize: true, | |
compress: { | |
warnings: false | |
} | |
}) | |
], | |
module: { | |
loaders: [{ | |
test: /.jsx?$/, | |
loader: 'babel-loader', | |
include: path.join(__dirname, 'app'), | |
exclude: /node_modules/, | |
query: { | |
presets: ['es2015', 'react'] | |
} | |
}] | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment