Closed
Description
Bug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.0.0
node: 6.10.2
os: darwin x64
Repro steps.
ng new my-project
cd my-project
ng g module my-component
ng g component my-component
touch index.ts
Create module in index.ts
:
import { NgModule } from '@angular/core';
import { MyComponentModule } from './src/app/my-component/my-component.module';
@NgModule({
imports: [ MyComponentModule ],
exports: [ MyComponentModule ]
})
class MyPublishModule {
}
Import index.ts
module in src/app/app.module.ts
:
...
import { MyPublishModule } from '../../';
@NgModule({
...
imports: [
...
MyPublishModule
]
...
})
...
Now ng serve
works fine, but ng build --prod
does not; it fails with this error:
ERROR in /Users/elclanrs/Documents/my-project/src/$$_gendir/index.ngfactory.ts
(1,1): Cannot find module './index'.
/Users/elclanrs/Documents/my-project/src/$$_gendir/index.ngfactory.ts (1,1): C
annot find module './src/app/my-component/my-component.module'.
This worked fine before v1.0.0 in Angular 2.4. If I move the index.ts
module to src/index.ts
and adjust the paths, then it works.
Also, ngc
doesn't complain. Any ideas what changed that caused this issue?