File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -645,11 +645,15 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
645
645
646
646
// build CSS handling ----------------------------------------------------
647
647
648
- const cssScopeTo = (
649
- this . getModuleInfo ( id ) ?. meta ?. vite as
650
- | CustomPluginOptionsVite
651
- | undefined
652
- ) ?. cssScopeTo
648
+ const cssScopeTo =
649
+ // NOTE: `this.getModuleInfo` can be undefined when the plugin is called directly
650
+ // adding `?.` temporary to avoid unocss from breaking
651
+ // TODO: remove `?.` after `this.getModuleInfo` in Vite 7
652
+ (
653
+ this . getModuleInfo ?.( id ) ?. meta ?. vite as
654
+ | CustomPluginOptionsVite
655
+ | undefined
656
+ ) ?. cssScopeTo
653
657
654
658
// record css
655
659
if ( ! inlined ) {
You can’t perform that action at this time.
0 commit comments