Closed Ks89 closed 7 years ago
Hi, the starter already comes with an external template (sample.component.html) and external style (sample.component.scss) which are working fine actually. Is there an example that you can provide to me to reproduce the issue?
Hi. Thank you for your answer. I'll give you an example in couple of days, because at the moment I haven't enough spare time.
I found this project that it's really famous: https://github.com/AngularClass/angular2-webpack-starter
I tried to import you library without any modifications and It won't start.
I received this error:
GET http://localhost:3000/sample.component.html 404 (Not Found)
Failed to load sample.component.html
Removing the external HTML file, I received this error:
GET http://localhost:3000/sample.component.scss 404 (Not Found)
Failed to load sample.component.scss
The same problem happens with angular-cli since it based on webpack2 + treeshaking.
How do you reference ngx-library-starter in your package.json, with the git URL like this?
"ngx-library-starter": "https://github.com/cankayacan/ngx-library-starter.git",
This will not use the bundled file but the webpack will bundle everything starting with index.ts on it's own and still working locally for me.
I have also published ngx-library-starter to the npm which is also working fine.
"ngx-library-starter": "0.0.1",
I am using the latest angular2-webpack-starter. You can check the sample usage here.
Damn! You are right. I wrote a script to copy dist folder into my systemjs demo's node_modules, and I copied and pasted it also for webpack.
Thank you for you support. Issue closed.
If I want to compile a personal library using this project everything seems ok. My systemjs demo is ok, but not webpack2 and angular-cli demos.
Using webpack2 with treeshaking (also without AOT in my demo project), compilation is ok, but I receive this error
Using angular-cli, compilation is ok, but I receive this error
The same problem happens with a templateUrl inside my library. If I use an external html file instead of an inline template I receive a similar error. It seems that relative paths cause these problems.
Could you confirm this?
Thanks