Skip to content

Instantly share code, notes, and snippets.

@avivshafir
Last active March 5, 2018 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avivshafir/8379dcad77d239ddccc66897a724a8bf to your computer and use it in GitHub Desktop.
Save avivshafir/8379dcad77d239ddccc66897a724a8bf to your computer and use it in GitHub Desktop.
webpack 4 loading vendors into vendor.js and generating a manifest file which includes the webpack runtime
mode: "production",
entry: {
app: path.join(__dirname, "index.tsx"),
},
output: {
path: path.resolve(__dirname, "public/dist"),
publicPath: "",
chunkFilename: "[name].js",
filename: "[name].js"
},
optimization: {
runtimeChunk: {
name: "manifest"
},
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "vendors",
priority: -20,
chunks: "all"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment