Skip to content

Commit

Permalink
fix(vite): generate on corresponding chunk (unocss#1935)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng authored and praburangki committed Jan 12, 2023
1 parent d71e2d6 commit ac2c2f7
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 ac2c2f7

Please sign in to comment.