Skip to content

Commit b58b8e7

Browse files
committed
Only split bundle on client
1 parent 41b0cb8 commit b58b8e7

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ config.prototype.addResolveAlias = function(key, value) {
132132
};
133133

134134
config.prototype.splitChunks = function(name, exp = /[\\/]node_modules[\\/]/) {
135-
splitChunks(this, name, exp);
135+
splitChunks(this, this._bundleType, name, exp);
136136
return this;
137137
};
138138

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geta-webpack-config-wrapper",
3-
"version": "2.0.0-beta.18",
3+
"version": "2.0.0-beta.19",
44
"description": "Webpack and tool configurations used to standardize the setup in projects.",
55
"author": "Eirik Horvath",
66
"license": "MIT",

proto/split-chunks.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
module.exports = function(context, name, exp) {
2-
context._optimization['splitChunks'] = {
3-
cacheGroups: {
4-
commons: {
5-
test: exp,
6-
name: name,
7-
chunks: 'all',
1+
const bundleTypes = require('../constants/bundle-types');
2+
3+
module.exports = function(context, bundleType, name, exp) {
4+
if (bundleType === bundleTypes.client) {
5+
context._optimization['splitChunks'] = {
6+
cacheGroups: {
7+
commons: {
8+
test: exp,
9+
name: name,
10+
chunks: 'all',
11+
},
812
},
9-
},
10-
};
13+
};
14+
}
1115
};

0 commit comments

Comments
 (0)