Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Last active September 18, 2016 15:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanflorence/9062bd7a9af3708256258cf186d6a852 to your computer and use it in GitHub Desktop.
Save ryanflorence/9062bd7a9af3708256258cf186d6a852 to your computer and use it in GitHub Desktop.
const webpack = require('webpack')
const path = require('path')
module.exports = {
entry: {
// the app bundle
main: path.join(__dirname, 'app.js'),
// the vendor bundle, white-list stuff here
vendor: [ 'react', 'react-dom' ]
},
output: {
path: path.join(__dirname, 'build'),
// will save "main.js" and "vendor.js"
filename: `[name].js`,
pubicPath: 'build/'
},
plugins: [
// this will find anything common between any of your bundles
// not found in the whitelist you specified and put them in
// vendor too!
new webpack.optimize.CommonsChunkPlugin('vendor', `vendor.js`),
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment