Skip to content

Commit

Permalink
fix(vite): avoid applying css transform on bundle generation
Browse files Browse the repository at this point in the history
close #1850
  • Loading branch information
equt committed Nov 12, 2022
1 parent d1b72c3 commit f4ba7f4
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 f4ba7f4

Please sign in to comment.