Skip to content

Commit bb660e1

Browse files
Ross-Esmondyyx990803
authored andcommitted
fix: added file property to the generated sourcemap (#1190)
1 parent 9a52bf4 commit bb660e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/parser.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ module.exports = (content, filename, needMap, sourceRoot, needCSSMap) => {
3838
}
3939

4040
function generateSourceMap (filename, source, generated, sourceRoot) {
41-
const map = new SourceMapGenerator({ sourceRoot })
41+
const map = new SourceMapGenerator({
42+
file: filename,
43+
sourceRoot
44+
})
4245
map.setSourceContent(filename, source)
4346
generated.split(splitRE).forEach((line, index) => {
4447
if (!emptyRE.test(line)) {

0 commit comments

Comments
 (0)