-
Notifications
You must be signed in to change notification settings - Fork 12k
ng build --prod not ignoring .spec.ts in subdirectories #4673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can confirm, using angular-cli 1.0.0-beta.30 and the project provided by @natedanner |
@natedanner I removed the |
Heya, this is solved in the latest RCs. You can follow https://github.com/angular/angular-cli/wiki/stories-rc-update to upgrade. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS
Mac OSX El Capitan 10.11.6
Versions.
@angular/cli: 1.0.0-beta.30
node: 6.9.1
os: darwin x64
@angular/common: 2.4.6
@angular/compiler: 2.4.6
@angular/core: 2.4.6
@angular/forms: 2.4.6
@angular/http: 2.4.6
@angular/platform-browser: 2.4.6
@angular/platform-browser-dynamic: 2.4.6
@angular/router: 3.4.6
@angular/cli: 1.0.0-beta.30
@angular/compiler-cli: 2.4.6
Repro steps.
The log given by the failure.
ERROR in Cannot determine the module for class TestSelectComponent in /Users/nate.danner/Desktop/aotSpecTest/src/app/test/app.component.spec.ts!
Cannot determine the module for class TestSelectComponent in /Users/nate.danner/Desktop/aotSpecTest/src/testing/test2/test-select.component.ts!
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/nate.danner/Desktop/aotSpecTest/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
Mention any other details that might be useful.
.spec.ts files lower than one directory from src are not ignored by the
angular-cli/packages/@angular/cli/models/webpack-configs/typescript.ts
angular-cli/packages/@ngtools/webpack/src/plugin.ts
Line 119 in 9548d90
// exclude is always set true
if (options.hasOwnProperty('exclude')) {
let exclude: string[] = typeof options.exclude == 'string'
? [options.exclude as string] : (options.exclude as string[]);
if I comment out everything and use "fileNames = fileNames.filter(fileName => !/.spec.ts$/.test(fileName));" locally then the spec files are ignored as they were before.
Example Project
aotSpecTest.zip
The text was updated successfully, but these errors were encountered: