diff --git a/packages/webpack/src/plugin.ts b/packages/webpack/src/plugin.ts index 4105c3f7cdbb..f6e95d7b3b5b 100644 --- a/packages/webpack/src/plugin.ts +++ b/packages/webpack/src/plugin.ts @@ -102,7 +102,8 @@ export class AotPlugin { } const tsConfig = tsc.readConfiguration(options.tsConfigPath, basePath); - this._rootFilePath = tsConfig.parsed.fileNames; + this._rootFilePath = tsConfig.parsed.fileNames + .filter(fileName => !/\.spec\.ts$/.test(fileName)); // Check the genDir. let genDir = basePath;