Skip to content

Instantly share code, notes, and snippets.

@innovid-rnd
Created March 6, 2018 12:23
Show Gist options
  • Save innovid-rnd/947ddfc8eeaea3e371fe8091023c542a to your computer and use it in GitHub Desktop.
Save innovid-rnd/947ddfc8eeaea3e371fe8091023c542a 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