Skip to content


Browse files Browse the repository at this point in the history
fix(vite): generate on corresponding chunk (#1935)
  • Loading branch information
sibbng committed Nov 30, 2022
1 parent d0c3d4b commit 1c5026f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vite/src/modes/global/build.ts
Expand Up @@ -147,6 +147,9 @@ export function GlobalModeBuildPlugin({ uno, ready, extract, tokens, filter, get
name: 'unocss:global:build:generate',
apply: 'build',
async renderChunk(code, chunk, options) {
if (!Object.keys(chunk.modules).some(i => i.match(RESOLVED_ID_RE)))
return null

const cssPost = cssPostPlugins.get(options.dir)
if (!cssPost) {
this.warn('[unocss] failed to find vite:css-post plugin. It might be an internal bug of UnoCSS')
Expand Down

0 comments on commit 1c5026f

Please sign in to comment.