Skip to content

Commit

Permalink
fix(@ngtools/webpack): skip transforming empty inline styles in Webpa…
Browse files Browse the repository at this point in the history
…ck JIT compilations

Empty styles break the Webpack resource loader / PostCSS and generate an error. Fortunately there's no work to be done there, so we can just skip it and leave the empty string.

(cherry picked from commit 7b02161)
  • Loading branch information
dgp1130 authored and alan-agius4 committed Oct 30, 2023
1 parent e259c1f commit 8899fb9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ function transformInlineStyleLiteral(
return node;
}

// Don't transform empty strings as PostCSS will choke on them. No work to do anyways.
if (node.text === '') {
return node;
}

if (!isInlineStyle) {
const url = getResourceUrl(node);

Expand Down

0 comments on commit 8899fb9

Please sign in to comment.