Skip to content

Commit 1cf7eee

Browse files
committed
fix: suppress warnings for non-recognized pseudo selectors form lightningcss
ref vitejs/vite-plugin-vue@15c0eb0
1 parent 8415325 commit 1cf7eee

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/core/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,20 @@ export const plugin: UnpluginInstance<Options | undefined, false> =
303303
!config.isProduction
304304
),
305305
}
306+
307+
// #507 suppress warnings for non-recognized pseudo selectors from lightningcss
308+
const _warn = config.logger.warn
309+
config.logger.warn = (...args) => {
310+
const msg = args[0]
311+
if (
312+
/\[lightningcss\] '(?:deep|slotted|global)' is not recognized as a valid pseudo-/.test(
313+
msg,
314+
)
315+
) {
316+
return
317+
}
318+
_warn(...args)
319+
}
306320
},
307321

308322
configureServer(server) {

0 commit comments

Comments
 (0)