Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
keep path of source file in source map (#895)
  • Loading branch information
Elevista authored and yyx990803 committed Aug 3, 2017
1 parent c48b6c7 commit 1cff850
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/selector.js
Expand Up @@ -9,7 +9,8 @@ var loaderUtils = require('loader-utils')
module.exports = function (content) {
this.cacheable()
var query = loaderUtils.getOptions(this) || {}
var filename = path.basename(this.resourcePath)
var context = (this._compiler && this._compiler.context) || this.options.context || process.cwd()
var filename = path.relative(context, this.resourcePath).replace(/\..+$/, '.vue')
var parts = parse(content, filename, this.sourceMap)
var part = parts[query.type]
if (Array.isArray(part)) {
Expand Down

0 comments on commit 1cff850

Please sign in to comment.