shlomiassaf / ngc-webpack

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

fix: resourceOverride doesn't work on Windows #3

Closed pglazkov closed 7 years ago

pglazkov commented 7 years ago

Fixing the problem with the "resourceOverride" option not having any effect when compiling on Windows (@Component resources are not replaced).

After some debugging I found that the paths in this.webpackWrapper.aotResources have different path separator ("/" vs. "\") than result.request and result.resource, causing the following condition to be false: this.webpackWrapper.aotResources[result.request] === true.

This change introduces normalization of the paths using Path.normalize to ensure they are the same across platforms.