Skip to content

Commit ff2fd57

Browse files
committed
add error for sourcePath
1 parent 8f02bdc commit ff2fd57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/map-generator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ class MapGenerator {
202202
if (this.mapOpts.from) {
203203
return this.toUrl(this.mapOpts.from)
204204
} else if (this.mapOpts.absolute) {
205-
return pathToFileURL(node.source.input.from).toString()
205+
if(pathToFileURL) {
206+
return pathToFileURL(node.source.input.from).toString()
207+
} else {
208+
throw new Error('map option "absolute" is not available in this postcss build')
209+
}
206210
} else {
207211
return this.toUrl(this.path(node.source.input.from))
208212
}

0 commit comments

Comments
 (0)