Skip to content

Commit 1cff850

Browse files
Elevistayyx990803
authored andcommitted
keep path of source file in source map (#895)
1 parent c48b6c7 commit 1cff850

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/selector.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ var loaderUtils = require('loader-utils')
99
module.exports = function (content) {
1010
this.cacheable()
1111
var query = loaderUtils.getOptions(this) || {}
12-
var filename = path.basename(this.resourcePath)
12+
var context = (this._compiler && this._compiler.context) || this.options.context || process.cwd()
13+
var filename = path.relative(context, this.resourcePath).replace(/\..+$/, '.vue')
1314
var parts = parse(content, filename, this.sourceMap)
1415
var part = parts[query.type]
1516
if (Array.isArray(part)) {

0 commit comments

Comments
 (0)