Skip to content

Commit 0db8b9a

Browse files
committed
fix: suppress warnings for non-recognized pseudo selectors form lightningcss
* @check vitejs/vite-plugin-vue#521 * @check vitejs/vite-plugin-vue#507
1 parent 7a2fcf6 commit 0db8b9a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
106106
replacement: 'vue/dist/vue.runtime.esm.js'
107107
})
108108
}
109+
110+
// suppress warnings for non-recognized pseudo selectors from lightningcss
111+
const _warn = config.logger.warn
112+
config.logger.warn = (...args) => {
113+
const msg = args[0]
114+
if (
115+
msg.match(
116+
/\[lightningcss\] '(v-deep|deep)' is not recognized as a valid pseudo-/,
117+
)
118+
) {
119+
return
120+
}
121+
_warn(...args)
122+
}
109123
},
110124

111125
configureServer(server) {

0 commit comments

Comments
 (0)