Skip to content

Commit

Permalink
fix(vite): avoid applying css transform on bundle generation (#1872)
Browse files Browse the repository at this point in the history
close #1850
  • Loading branch information
equt committed Nov 13, 2022
1 parent f2cef8d commit 90c6ef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/modes/global/build.ts
Expand Up @@ -175,9 +175,9 @@ export function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, get
.replace(HASH_PLACEHOLDER_RE, '')
chunk.source = await replaceAsync(css, LAYER_PLACEHOLDER_RE, async (_, __, layer) => {
replaced = true
return await applyCssTransform(layer === LAYER_MARK_ALL
return layer === LAYER_MARK_ALL
? result.getLayers(undefined, Array.from(vfsLayers))
: result.getLayer(layer) || '', `${chunk.fileName}.css`, options.dir)
: result.getLayer(layer) || ''
})
}
else if (chunk.type === 'chunk' && typeof chunk.code === 'string') {
Expand Down

0 comments on commit 90c6ef8

Please sign in to comment.