Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var webpack = require('webpack');
module.exports = {
entry: './public/js/render.jsx',
output: {
// Output the bundled file.
path: './public/build',
// Use the name specified in the entry key as name for the bundle file.
filename: 'bundle.js'
},
module: {
loaders: [{
// Test for js or jsx files.
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
}]
},
externals: {
// Don't bundle the 'react' npm package with the component.
'react': 'React'
},
resolve: {
// Include empty string '' to resolve files by their explicit extension
// (e.g. require('./somefile.ext')).
// Include '.js', '.jsx' to resolve files by these implicit extensions
// (e.g. require('underscore')).
extensions: ['', '.js', '.jsx']
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.