Skip to content

Instantly share code, notes, and snippets.

@alkhe
Created May 2, 2015 18:31
Show Gist options
  • Save alkhe/f98acefb556195ee2da1 to your computer and use it in GitHub Desktop.
Save alkhe/f98acefb556195ee2da1 to your computer and use it in GitHub Desktop.
Vendor Webpack Config
var path = require('path'),
w = require('webpack');
module.exports = {
entry: {
app: path.resolve(__dirname, 'client/js/index.js'),
vendors: ['react', 'socket.io', 'react-router', 'alt']
},
output: {
path: path.resolve(__dirname, 'public/js'),
filename: 'bundle.js'
},
resolve: {
root: path.resolve(__dirname, 'public/vendor'),
extensions: ['', '.js', '.jsx', '.json']
},
module: {
loaders: [{
test: /\.js$/,
exclude: [/node_modules\//, /vendor\//],
loader: 'babel'
}],
noParse: [/node_modules\//]
},
plugins: [
new w.optimize.CommonsChunkPlugin('vendors', 'vendors.js')
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment