shlomiassaf / ngc-webpack

Angular compiler-cli with webpack's loader chain.
MIT License
84 stars 15 forks source link

resourceOverride brakes images in css and html (Linux only) #4

Closed Andrey-Pavlov closed 7 years ago

Andrey-Pavlov commented 7 years ago

Images aren't emitted. Comment out 'resourceOverride' fix the problem. Any suggestions? https://github.com/AngularClass/angular2-webpack-starter/commit/5d856318820d80fd375ac30b123efc755e04564b#commitcomment-20482445

How resourceOverride works? I don't understand this feature.

shlomiassaf commented 7 years ago

@Andrey-Pavlov the resourceOverride feature is used to replace the html and css imports in @Component metadata with empty js files.

The reason to do so is because it is redundant data, it is not being used at runtime anyway since the AOT compiler creates a separate version of it.

If you have a complex setup and you reference images from within a component css then you might run into issues.

I havent checked that deeply, but you can remove this feature for now and you won't have issues.

shlomiassaf commented 7 years ago

OK, the issue is probably not coping the resources to the dist folder, I will check it when I have some time, please turn it off for now.

shlomiassaf commented 7 years ago

Long story short, resourceOverride removes template/styles from @Component to save space and let the AOT compiler handle them. If you have resources in components then they won't get copied...