Last active
September 18, 2016 15:28
-
-
Save ryanflorence/9062bd7a9af3708256258cf186d6a852 to your computer and use it in GitHub Desktop.
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 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