You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MacOS El Capitan
angular-cli: 1.0.0-beta.21
node: 6.9.2
os: darwin x64
I'm building an Angular2 library for my other Angular2 applications. The library project was build using angular2-webpack-starter. I really like how angular cli works, so I removed all the webpack configs and moved the entire project to use angular cli.
This is my project folder structure. roughly...
my-library-project/
├──example/ * the demo application to showcase how to consume the library
├──lib/ * the library folder
| ├──my-library.module.ts * the library entry module
| └──... * other library component/files
├──angular-cli.json * cli config file
├──tslint.json * typescript lint config
├──typedoc.json * typescript documentation generator
├──tsconfig.json * config that webpack uses for typescript
└──package.json * what npm uses to manage it's dependencies
The example folder is an application to showcase how to import/use the library. So it is essentially an angular2 application.
For the migration, I ran ng init --source-dir example in the my project folder so that cli will point the source folder to example instead of src.
Everything seems to work except:
I can't generate components outside of example folder, in my case I would like to generate them in the lib folder as well.
ng build --aot or ng serve --aot is giving me the following error, but I get no error while running ng serve or ng build. It is like the webpack AOT config doesn't care about any thing outside of project app folder.
ERROR in ./example/app/example.component.ngfactory.ts
Module not found: Error: Can't resolve '../../lib/my-library.component.ngfactory' in '/Users/bfwg/code/my-library/example/app'
@ ./example/app/example.component.ngfactory.ts 27:0-63
@ ./example/app/app.module.ngfactory.ts
@ ./example/main.ts
@ multi main
The text was updated successfully, but these errors were encountered:
bfwg
changed the title
Using angular-cli to generate a components in different source files.
Using angular-cli to generate a components in different source folders.
Dec 23, 2016
MacOS El Capitan
angular-cli: 1.0.0-beta.21
node: 6.9.2
os: darwin x64
I'm building an Angular2 library for my other Angular2 applications. The library project was build using angular2-webpack-starter. I really like how angular cli works, so I removed all the webpack configs and moved the entire project to use angular cli.
This is my project folder structure. roughly...
The example folder is an application to showcase how to import/use the library. So it is essentially an angular2 application.
For the migration, I ran
ng init --source-dir example
in the my project folder so that cli will point the source folder toexample
instead of src.Everything seems to work except:
ng build --aot
orng serve --aot
is giving me the following error, but I get no error while runningng serve
orng build
. It is like the webpack AOT config doesn't care about any thing outside of project app folder.The text was updated successfully, but these errors were encountered: