Skip to content

Commit

Permalink
refactor: fsp + remove toLowerCase
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jul 24, 2024
1 parent 6e847c0 commit 3bf2dc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,7 @@ const makeModernScssWorker = (
if (result.contents) {
return result.contents
}
return await fs.promises.readFile(result.file, 'utf-8')
return await fsp.readFile(result.file, 'utf-8')
}

const worker = new WorkerWithFallback(
Expand Down Expand Up @@ -2229,9 +2229,9 @@ const makeModernScssWorker = (
async load(canonicalUrl) {
const ext = path.extname(canonicalUrl.pathname)
let syntax: Sass.Syntax = 'scss'
if (ext && ext.toLowerCase() === '.sass') {
if (ext === '.sass') {
syntax = 'indented'
} else if (ext && ext.toLowerCase() === '.css') {
} else if (ext === '.css') {
syntax = 'css'
}
const contents = await internalLoad(
Expand Down

0 comments on commit 3bf2dc1

Please sign in to comment.