zambezi / ez-build

Zambezi build tool
MIT License
2 stars 1 forks source link

update relative paths URLs using postcss-url #53

Closed matthewdunsdon closed 6 years ago

matthewdunsdon commented 7 years ago

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

@import "./icons/icon-pack-24.css";
@import "./icons/icon-pack-32.css";
/* ... */

src/styles/icons/icon-pack-24.css

.icon-badge-24 {
    background-image: url("../../assets/icons/badge-24px.png");
}
/* ... */

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

Description

Added a build step so that for relative URLs, the correct relative path chosen.

Motivation and Context

Motivations for this change are discussed in #48.

How Was This Tested?

Tests added and manual testing on a project.

Types of changes

Checklist:

codecov-io commented 7 years ago

Codecov Report

Merging #53 into master will increase coverage by 1.65%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   93.37%   95.03%   +1.65%     
==========================================
  Files          15       15              
  Lines         317      322       +5     
==========================================
+ Hits          296      306      +10     
+ Misses         21       16       -5
Impacted Files Coverage Δ
src/postbuild/rebase-prod-css.js 100% <100%> (+83.33%) :arrow_up:
src/builder/css.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c555037...9b2d36b. Read the comment docs.

matthewdunsdon commented 7 years ago

As this is a breaking change, we need to be strategic with how we merge and deploy these changes.

@mstade Can you make the call when the code gets merged in and deployed?