Skip to content

Commit 7dbcf24

Browse files
committed
fix(helper): fix test since webpack 4 changes
since `webpack.optimize.CommonsChunkPlugin` was removed it recommend `config.optimization.splitChunks` instead
1 parent f34b92d commit 7dbcf24

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"index.js"
4242
],
4343
"peerDependencies": {
44-
"webpack": "^4.3.0"
44+
"webpack": "^4.12.0"
4545
},
4646
"dependencies": {
4747
"@webpack-contrib/schema-utils": "^1.0.0-beta.0",

test/helpers/compiler.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ const modules = (config) => {
2222
};
2323
};
2424

25-
const plugins = (config) =>
26-
[
27-
new webpack.optimize.CommonsChunkPlugin({
28-
names: ['runtime'],
29-
minChunks: Infinity,
30-
}),
31-
].concat(config.plugins || []);
25+
const plugins = (config) => [].concat(config.plugins || []);
3226

3327
const output = (config) => {
3428
return {

test/loader.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Loader', () => {
1010
};
1111

1212
const stats = await webpack('fixture.js', config);
13-
const { source } = stats.toJson().modules[1];
13+
const [{ source }] = stats.toJson().modules;
1414

1515
expect(source).toMatchSnapshot();
1616
});

test/options.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('Options', () => {
1111
};
1212

1313
const stats = await webpack('fixture.js', config);
14-
const { source } = stats.toJson().modules[1];
14+
const [{ source }] = stats.toJson().modules;
1515

1616
expect(source).toMatchSnapshot();
1717
});

0 commit comments

Comments
 (0)