Skip to content

Commit

Permalink
fix(less): empty less file error (#7412)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyouzu1 committed Mar 23, 2022
1 parent 4538e59 commit 0535c70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -1316,8 +1316,10 @@ const less: StylePreprocessor = async (source, root, options, resolvers) => {
return { code: '', errors: [normalizedError], deps: [] }
}

const map: ExistingRawSourceMap = JSON.parse(result.map)
delete map.sourcesContent
const map: ExistingRawSourceMap = result.map && JSON.parse(result.map)
if (map) {
delete map.sourcesContent
}

return {
code: result.css.toString(),
Expand Down

0 comments on commit 0535c70

Please sign in to comment.