We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
?.
this.getModuleInfo
vite:css-post
1 parent d686252 commit 12b0b8aCopy full SHA for 12b0b8a
packages/vite/src/node/plugins/css.ts
@@ -645,11 +645,15 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
645
646
// build CSS handling ----------------------------------------------------
647
648
- const cssScopeTo = (
649
- this.getModuleInfo(id)?.meta?.vite as
650
- | CustomPluginOptionsVite
651
- | undefined
652
- )?.cssScopeTo
+ const cssScopeTo =
+ // NOTE: `this.getModuleInfo` can be undefined when the plugin is called directly
+ // adding `?.` temporary to avoid unocss from breaking
+ // TODO: remove `?.` after `this.getModuleInfo` in Vite 7
+ (
653
+ this.getModuleInfo?.(id)?.meta?.vite as
654
+ | CustomPluginOptionsVite
655
+ | undefined
656
+ )?.cssScopeTo
657
658
// record css
659
if (!inlined) {
0 commit comments