FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

absolute sourcemaps have source content · postcss/postcss@3dac15c · GitHub

Commit 3dac15c

Browse files
committed
absolute sourcemaps have source content
1 parent 767c83e commit 3dac15c

3 files changed

Lines changed: 6606 additions & 4 deletions

File tree

‎lib/map-generator.js‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,17 @@ class MapGenerator {
9797
let from = node.source.input.from
9898
if (from && !already[from]) {
9999
already[from] = true
100-
this.map.setSourceContent(
101-
this.toUrl(this.path(from)),
102-
node.source.input.css
103-
)
100+
let fromUrl = this.toUrl(this.path(from))
101+
if (this.mapOpts.absolute) {
102+
if (pathToFileURL) {
103+
fromUrl = pathToFileURL(from).toString()
104+
} else {
105+
throw new Error(
106+
'`map.absolute` option is not available in this PostCSS build'
107+
)
108+
}
109+
}
110+
this.map.setSourceContent(fromUrl, node.source.input.css)
104111
}
105112
}
106113
})

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL