Skip to content

Commit

Permalink
add error for sourcePath
Browse files Browse the repository at this point in the history
  • Loading branch information
barak007 committed Apr 10, 2021
1 parent 8f02bdc commit ff2fd57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/map-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ class MapGenerator {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from)
} else if (this.mapOpts.absolute) {
return pathToFileURL(node.source.input.from).toString()
if(pathToFileURL) {
return pathToFileURL(node.source.input.from).toString()
} else {
throw new Error('map option "absolute" is not available in this postcss build')
}
} else {
return this.toUrl(this.path(node.source.input.from))
}
Expand Down

0 comments on commit ff2fd57

Please sign in to comment.