Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(css): handle lightningcss compiled css in Deno #17301

Merged
merged 3 commits into from
May 27, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2759,8 +2759,11 @@ async function compileLightningCSS(
? config.css?.lightningcss?.cssModules ?? true
: undefined,
})

let css = res.code.toString()
// https://github.com/vitejs/vite/pull/17301
// NodeJS res.code = Buffer
// Deno res.code = Uint8Array
// For correct handle compiled css need to use TextDecoder
let css = new TextDecoder().decode(res.code)
bluwy marked this conversation as resolved.
Show resolved Hide resolved
for (const dep of res.dependencies!) {
switch (dep.type) {
case 'url':
Expand Down