Split preact into separate webpack chunk

This commit is contained in:
hensm
2020-09-04 18:56:19 +01:00
parent 01045a1889
commit 0d5e332b83
2 changed files with 373 additions and 0 deletions

View File

@@ -83,6 +83,17 @@ module.exports = (env) => ({
, chunks: [ "ui/options/bundle" ]
})
]
, optimization: {
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/](preact|preact\/compat)[\\/]/
, name: "vendor"
, chunks: "initial"
}
}
}
}
, module: {
rules: [
{