systemjs / builder

SystemJS build tool
MIT License
465 stars 122 forks source link

External Angular 2 stylesheets and templates cause 404 errors in browser #752

Open dicbrus opened 7 years ago

dicbrus commented 7 years ago

Despite this brunch is closed https://github.com/systemjs/builder/issues/611 the issue is not solved.

buildStatic not working properly with external css/html

Few details:

My app is under ./source/app and external html file (for example) is /source/app/something/something.component.html

buildStatic WITHOUT 'encodeNames: false' lead to 404 error, loading html external file from root like '/something.component.html'

buildStatic WITH 'encodeNames: false' it also lead to 404 but in a different way: it tries to load '/source/app/something/something.component.html

everything is working fine when I use SystemJs (without systemjs builder). But is it suitable only for dev.

Is it the only way to solve it - inline html/css files? Or move to webpack?

P.S. Relative paths are important for aot compilation so ... any ideas?

Thank you

jzaric commented 7 years ago

+1 Having the same issue here. Have you found the solution in the mean time?

jzaric commented 7 years ago

@dicbrus Found a solution. Don't use buildStatic() which creates self-executing bundle. use bundle() instead. And keep the same Githubissues.

  • Githubissues is a development platform for aggregating issues.