Skip to content

Commit

Permalink
improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
KingSora committed Oct 12, 2022
1 parent 3d0d204 commit edfd3e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/map-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class MapGenerator {
this.root = root
this.opts = opts
this.css = cssString
this.fileUrls = !this.mapOpts.from && this.mapOpts.absolute
}

isMap() {
Expand Down Expand Up @@ -98,7 +99,7 @@ class MapGenerator {
if (from && !already[from]) {
already[from] = true
let fromUrl = this.toUrl(this.path(from))
if (this.mapOpts.absolute) {
if (this.fileUrls) {
if (pathToFileURL) {
fromUrl = pathToFileURL(from).toString()
} else {
Expand Down Expand Up @@ -242,7 +243,7 @@ class MapGenerator {
sourcePath(node) {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from)
} else if (this.mapOpts.absolute) {
} else if (this.fileUrls) {
if (pathToFileURL) {
return pathToFileURL(node.source.input.from).toString()
} else {
Expand Down

0 comments on commit edfd3e0

Please sign in to comment.