-
-
Save adewalegeorge/b9528b8f93f561924de243c6eba0d0ac 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
var CommonsPlugin = new require("webpack/lib/optimize/CommonsChunkPlugin"); | |
var webpack = new require("webpack"); | |
module.exports = { | |
entry: { | |
home: "./scripts/home.js", | |
apis: "./scripts/api.js", | |
app: "./scripts/app.js", | |
vendor: "./scripts/vendor.js" | |
}, | |
module:{ | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|bower_components)/, | |
loader: 'babel', // 'babel-loader' is also a valid name to reference | |
query: { | |
presets: ['es2015'] | |
} | |
}, | |
{ | |
test: /\.tag$/, | |
loader: 'tag' | |
} | |
] | |
}, | |
plugins: [ | |
new CommonsPlugin({ | |
minChunks: Infinity, | |
name: "vendor" | |
}) | |
], | |
output: { | |
// Make sure to use [name] or [id] in output.filename | |
// when using multiple entry points | |
filename: "./build/[name].bundle.js", | |
chunkFilename: "[id].bundle.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment