Skip to content

Commit

Permalink
fix(vite): avoid applying css transform on bundle generation (unocss#…
Browse files Browse the repository at this point in the history
  • Loading branch information
equt authored and praburangki committed Jan 12, 2023
1 parent 1866429 commit bf10123
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 bf10123

Please sign in to comment.