Closed matthewdunsdon closed 6 years ago
Thanks for this excellent report!
One thing worth noting: ez-build doesn't follow require statements (they're just opaque function calls) so the CSS loader step shouldn't be necessary to reproduce this issue.
I'll see about making a fixture for this and write some tests based on this report, that should then fail. Then we should be able to proceed with implementing a fix. Great report, thanks a lot!
Fixed in #53.
The issue is due to the import of stylesheets not getting their URL paths rebased, which causes issues when referencing from CSS in a different directory.
src/styles/icons.css
src/styles/icons/icon-pack-24.css
Image icon is at path
<project-root>/src/assets/icons/badge-24px.png
and when build with ez-build it gets coppied to<project-root>/lib/assets/icons/badge-24px.png
Expected Behavior
When it is a development or production build, I would expect it to produce the correct relative paths:
Development
lib/styles/icons.css
Production
project-min.css
Current Behavior
What actually happens is:
Development
lib/styles/icons.css
Production
project-min.css
A workaround that is being used at the moment is to make the change:
src/styles/icons/icons-20.css
However I have chatted with @mstade and he made a great point:
Steps to Reproduce (for bugs)
<project-root>/src/assets/icons/badge-24px.png
Context
We are trying to use ez-build with images, where CSS files are not all in one directory (i.e. sub directories used).
Environment