File tree 1 file changed +7
-2
lines changed
packages/@angular/cli/models/webpack-configs
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,9 @@ export function getAotConfig(wco: WebpackConfigOptions) {
134
134
// Fallback to exclude spec files from AoT compilation on projects using a shared tsconfig.
135
135
if ( testTsConfigPath === tsConfigPath ) {
136
136
let exclude = [ '**/*.spec.ts' ] ;
137
- if ( appConfig . test ) { exclude . push ( path . join ( projectRoot , appConfig . root , appConfig . test ) ) ; }
137
+ if ( appConfig . test ) {
138
+ exclude . push ( path . join ( projectRoot , appConfig . root , appConfig . test ) ) ;
139
+ }
138
140
pluginOptions . exclude = exclude ;
139
141
}
140
142
@@ -164,7 +166,10 @@ export function getNonAotTestConfig(wco: WebpackConfigOptions) {
164
166
// Force include main and polyfills.
165
167
// This is needed for AngularCompilerPlugin compatibility with existing projects,
166
168
// since TS compilation there is stricter and tsconfig.spec.ts doesn't include them.
167
- const include = [ appConfig . main , appConfig . polyfills ] ;
169
+ const include = [ appConfig . main , appConfig . polyfills , '**/*.spec.ts' ] ;
170
+ if ( appConfig . test ) {
171
+ include . push ( appConfig . test ) ;
172
+ }
168
173
169
174
let pluginOptions : any = { tsConfigPath, skipCodeGeneration : true , include } ;
170
175
You can’t perform that action at this time.
0 commit comments