Skip to content

Commit 4182001

Browse files
committed
feat(css): output warnings from lightningcss
1 parent f7b1964 commit 4182001

File tree

1 file changed

+9
-0
lines changed
  • packages/vite/src/node/plugins

1 file changed

+9
-0
lines changed

packages/vite/src/node/plugins/css.ts

+9
Original file line numberDiff line numberDiff line change
@@ -3231,6 +3231,15 @@ async function compileLightningCSS(
32313231
throw e
32323232
}
32333233

3234+
for (const warning of res.warnings) {
3235+
let msg = `[vite:css][lightningcss] ${warning.message}`
3236+
msg += `\n${generateCodeFrame(src, {
3237+
line: warning.loc.line,
3238+
column: warning.loc.column - 1, // 1-based
3239+
})}`
3240+
environment.logger.warn(colors.yellow(msg))
3241+
}
3242+
32343243
// NodeJS res.code = Buffer
32353244
// Deno res.code = Uint8Array
32363245
// For correct decode compiled css need to use TextDecoder

0 commit comments

Comments
 (0)