Skip to content

Commit

Permalink
disable url based features
Browse files Browse the repository at this point in the history
  • Loading branch information
barak007 committed Apr 10, 2021
1 parent a54d020 commit 8f02bdc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ class Input {

result.input = { line, column, source: this.css }
if (this.file) {
result.input.url = pathToFileURL(this.file).toString()
if(pathToFileURL) {
result.input.url = pathToFileURL(this.file).toString()
}
result.input.file = this.file
}

Expand Down Expand Up @@ -162,7 +164,11 @@ class Input {
}

if (fromUrl.protocol === 'file:') {
result.file = fileURLToPath(fromUrl)
if(fileURLToPath){
result.file = fileURLToPath(fromUrl)
} else {
throw new Error(`file: protocol is not available in this postcss build`);
}
}

let source = consumer.sourceContentFor(from.source)
Expand Down
2 changes: 1 addition & 1 deletion lib/map-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let { dirname, resolve, relative, sep } = require('path')
let { pathToFileURL } = require('url')
let mozilla = require('source-map')

let pathAvailable = Boolean(dirname, resolve, relative, sep)
let pathAvailable = Boolean(dirname && resolve && relative && sep)

class MapGenerator {
constructor(stringify, root, opts) {
Expand Down

0 comments on commit 8f02bdc

Please sign in to comment.