Skip to content

Commit 8f02bdc

Browse files
committed
disable url based features
1 parent a54d020 commit 8f02bdc

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/input.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class Input {
130130

131131
result.input = { line, column, source: this.css }
132132
if (this.file) {
133-
result.input.url = pathToFileURL(this.file).toString()
133+
if(pathToFileURL) {
134+
result.input.url = pathToFileURL(this.file).toString()
135+
}
134136
result.input.file = this.file
135137
}
136138

@@ -162,7 +164,11 @@ class Input {
162164
}
163165

164166
if (fromUrl.protocol === 'file:') {
165-
result.file = fileURLToPath(fromUrl)
167+
if(fileURLToPath){
168+
result.file = fileURLToPath(fromUrl)
169+
} else {
170+
throw new Error(`file: protocol is not available in this postcss build`);
171+
}
166172
}
167173

168174
let source = consumer.sourceContentFor(from.source)

lib/map-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let { dirname, resolve, relative, sep } = require('path')
44
let { pathToFileURL } = require('url')
55
let mozilla = require('source-map')
66

7-
let pathAvailable = Boolean(dirname, resolve, relative, sep)
7+
let pathAvailable = Boolean(dirname && resolve && relative && sep)
88

99
class MapGenerator {
1010
constructor(stringify, root, opts) {

0 commit comments

Comments
 (0)