Skip to content

Instantly share code, notes, and snippets.

@rusty-key
Created July 30, 2020 11:13
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 rusty-key/fa83afbd2e4a62b1dfb77124aa1c08be to your computer and use it in GitHub Desktop.
Save rusty-key/fa83afbd2e4a62b1dfb77124aa1c08be to your computer and use it in GitHub Desktop.
webpack.config.js
module.exports = (_, argv) => {
return {
entry: {
app1: "/path/to/app1/index.js",
app2: "/path/to/app2/index.js",
app3: "/path/to/app3/index.js",
},
optimization: {
splitChunks: {
cacheGroups: {
react: {
name: 'react',
chunks: 'all',
test: /[\\/]node_modules[\\/](react|react-dom|reason-react)[\\/]/,
},
intl: {
name: 'intl',
chunks: 'all',
test: /[\\/]node_modules[\\/](react-intl|bs-react-intl|intl-.*)[\\/]/,
},
vendors: {
name: 'vendors',
chunks: 'all',
test: /[\\/]node_modules[\\/]/,
},
shared: {
name: 'shared',
chunks: 'all',
test: /[\\/]shared[\\/]/,
},
}
},
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment