Skip to content

Instantly share code, notes, and snippets.

@skywritergr
Last active January 12, 2016 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skywritergr/fb09073e6606b4c51f19 to your computer and use it in GitHub Desktop.
Save skywritergr/fb09073e6606b4c51f19 to your computer and use it in GitHub Desktop.
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