Skip to content

Commit 07f0d91

Browse files
committed
refactor test vendor logic
1 parent 8ce35de commit 07f0d91

File tree

1 file changed

+9
-12
lines changed
  • packages/@angular/cli/models/webpack-configs

1 file changed

+9
-12
lines changed

packages/@angular/cli/models/webpack-configs/test.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ export function getTestConfig(testConfig: WebpackTestOptions) {
7070
});
7171
}
7272

73-
if (true) {
74-
extraPlugins.push(new webpack.optimize.CommonsChunkPlugin({
75-
minChunks: Infinity,
76-
name: 'inline'
77-
}));
78-
extraPlugins.push(new webpack.optimize.CommonsChunkPlugin({
79-
name: 'vendor',
80-
chunks: ['main'],
81-
minChunks: (module: any) => module.resource && module.resource.startsWith(nodeModules)
82-
}));
83-
}
84-
8573
return {
8674
devtool: testConfig.sourcemaps ? 'inline-source-map' : 'eval',
8775
entry: {
@@ -91,6 +79,15 @@ export function getTestConfig(testConfig: WebpackTestOptions) {
9179
rules: [].concat(extraRules)
9280
},
9381
plugins: [
82+
new webpack.optimize.CommonsChunkPlugin({
83+
minChunks: Infinity,
84+
name: 'inline'
85+
}),
86+
new webpack.optimize.CommonsChunkPlugin({
87+
name: 'vendor',
88+
chunks: ['main'],
89+
minChunks: (module: any) => module.resource && module.resource.startsWith(nodeModules)
90+
}),
9491
// new webpackBuildLogger({ logEnabled: true }),
9592
// new (<any>FileListPlugin)(),
9693
new KarmaWebpackEmitlessError()

0 commit comments

Comments
 (0)