Skip to content

Instantly share code, notes, and snippets.

@mikezhuyuan
Last active November 5, 2015 05:05
Show Gist options
  • Save mikezhuyuan/43149349760806020a02 to your computer and use it in GitHub Desktop.
Save mikezhuyuan/43149349760806020a02 to your computer and use it in GitHub Desktop.
// npm install webpack react reactdom babel-preset-react babel-core babel-loader
module.exports = {
entry: './app.jsx',
output: {
path: './dist',
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.jsx$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['react']
}
}]
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM'
},
resolve: {
extensions: ['', '.js', '.jsx']
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment