Skip to content

Commit

Permalink
fix: vite build --watch not emitting anything (#2108)
Browse files Browse the repository at this point in the history
There was a regression introduced by b7a6687
where vite projects built using `vite build --watch` will only generate once.
Subsequent generations will just leave the placeholder.

See #963
  • Loading branch information
clarkf committed Jan 25, 2023
1 parent 7ce2756 commit 3b414da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/modes/global/build.ts
Expand Up @@ -93,8 +93,10 @@ export function GlobalModeBuildPlugin(ctx: UnocssPluginContext<VitePluginConfig>
},
load(id) {
const layer = resolveLayer(getPath(id))
if (layer)
if (layer) {
vfsLayers.add(layer)
return getLayerPlaceholder(layer)
}
},
moduleParsed({ id, importedIds }) {
if (!layerImporterMap.has(id))
Expand Down

0 comments on commit 3b414da

Please sign in to comment.