shlomiassaf / ngc-webpack

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

css image not generated after upgrading from 1.2.0 to 2.0.0 #17

Closed dereklin closed 7 years ago

dereklin commented 7 years ago

I have style that includes this:

background-image: url(~assets/images/header_background.png);

When using ngc-webpack 1.2.0, an image is generated during aot build. After upgrading to 2.0.0, the image is no longer generated. Do I need to change some settings?

The build is done on a linux box.

jkreileder commented 7 years ago

Yep, don't set resourceOverride:

   * ### resourceOverride and assets
   * If you reference assets in your styles/html that are not inlined and you expect a loader (e.g. url-loader)
   * to copy them, don't use the `resourceOverride` feature as it does not support this feature at the moment.
   * With `resourceOverride` the end result is that webpack will replace the asset with an href to the public
   * assets folder but it will not copy the files. This happens because the replacement is done in the AOT compilation
   * phase but in the bundling it won't happen (it's being replaced with and empty file...)
shlomiassaf commented 7 years ago

I'll close this stale issue, please re-open with a comment if it still an issue.