Skip to content

Commit 618cb7d

Browse files
committed
fix: respect map.annotation string
1 parent 745ad2c commit 618cb7d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function css(css, file) {
222222
tasks.push(fs.outputFile(options.to, result.css))
223223

224224
if (result.map) {
225-
const mapfile = getMapfile(options.to)
225+
const mapfile = getMapfile(opts)
226226
tasks.push(fs.outputFile(mapfile, result.map))
227227
}
228228
} else process.stdout.write(result.css, 'utf8')

lib/getMapfile.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
'use strict'
2-
module.exports = function getMapfile(p) {
3-
return `${p}.map`
2+
const path = require('path')
3+
module.exports = function getMapfile(options) {
4+
if (options.map && typeof options.map.annotation === 'string') {
5+
return path.join(path.dirname(options.to), options.map.annotation)
6+
}
7+
return `${options.to}.map`
48
}

0 commit comments

Comments
 (0)