Skip to content

Instantly share code, notes, and snippets.

@rusty-key rusty-key/webpack.config.js Secret

Created Jul 30, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.