Skip to content

Instantly share code, notes, and snippets.

@devrchancay
Last active September 1, 2017 06:50
Show Gist options
  • Select an option

  • Save devrchancay/0506a3a8e563ec3e7fed49d6b4899ea9 to your computer and use it in GitHub Desktop.

Select an option

Save devrchancay/0506a3a8e563ec3e7fed49d6b4899ea9 to your computer and use it in GitHub Desktop.
var webpack = require("webpack");
var path = require("path");
const removeEmpty = array => array.filter(p => !!p);
module.exports = {
entry: {
app: path.join(__dirname, "src"),
vendor: ["react", "react-dom", "react-router-dom", "react-form"]
},
output: {
path: path.join(__dirname, "dist"),
filename: "elperverso_app.js",
chunkFilename: "elperverso_gigya.js"
},
module: {
loaders: [
{
test: path.join(__dirname, "src"),
exclude: /node_modules/,
loader: "babel-loader"
}
]
},
plugins: removeEmpty([
new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
minChunks: Infinity,
filename: "elperverso_[name].js"
})
]),
resolve: {
modules: [path.resolve("./src"), path.resolve("./node_modules")]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment