Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webpack): correctly output CSS string #3686

Merged
merged 1 commit into from Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/webpack/src/index.ts
Expand Up @@ -130,6 +130,7 @@ export default function WebpackPlugin<Theme extends object>(
return

let code = compilation.assets[file].source().toString()
let escapeCss: ReturnType<typeof getCssEscaperForJsContent>
let replaced = false
code = code.replace(HASH_PLACEHOLDER_RE, '')
code = code.replace(LAYER_PLACEHOLDER_RE, (_, layer, escapeView) => {
Expand All @@ -139,7 +140,7 @@ export default function WebpackPlugin<Theme extends object>(
.map(i => resolveLayer(i)).filter((i): i is string => !!i))
: (result.getLayer(layer) || '')

const escapeCss = getCssEscaperForJsContent(escapeView)
escapeCss = escapeCss ?? getCssEscaperForJsContent(escapeView)

return escapeCss(css)
})
Expand Down