Skip to content

Fix Sass compilation rebuild after error#10377

Merged
aduth merged 3 commits intomainfrom
aduth-fix-sass-error-rebuild
Apr 8, 2024
Merged

Fix Sass compilation rebuild after error#10377
aduth merged 3 commits intomainfrom
aduth-fix-sass-error-rebuild

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Apr 5, 2024

🛠 Summary of changes

Fixes @18f/identity-build-sass to rebuild stylesheets as expected after saving a file that had previously triggered an error.

This relied on parsing a stack trace produced by Sass. It appears that this stack trace was updated to produce paths relative from the compiler executable.

For future consideration:

📜 Testing Plan

  1. yarn build-sass app/components/click_observer_component.scss --watch --verbose
  2. Edit and save app/components/click_observer_component.scss to cause an error, e.g. removing a curly brace
    - diff --git a/app/components/click_observer_component.scss b/app/components/click_observer_component.scss
    index 0d9671bba4..1c5c14cb44 100644
    --- a/app/components/click_observer_component.scss
    +++ b/app/components/click_observer_component.scss
    @@ -1,3 +1,2 @@
     lg-click-observer {
       display: contents;
    -}
  3. Observe error in terminal
  4. Edit and save app/components/click_observer_component.scss to fix error
  5. Observe in terminal that rebuild occurs as expected
    Building files [ 'app/components/click_observer_component.scss' ]
    

@aduth aduth requested a review from zachmargolis April 5, 2024 21:14
@aduth
Copy link
Contributor Author

aduth commented Apr 8, 2024

See sass/sass#3830

@aduth aduth merged commit bf4f7c1 into main Apr 8, 2024
@aduth aduth deleted the aduth-fix-sass-error-rebuild branch April 8, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants