Skip to content

Commit

Permalink
fix: empty less file error
Browse files Browse the repository at this point in the history
  • Loading branch information
tyouzu1 committed Mar 23, 2022
1 parent 0cc743b commit 70341bc
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) : undefined
if(map && map.sourcesContent){
delete map.sourcesContent;
}

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

0 comments on commit 70341bc

Please sign in to comment.