Skip to content

Commit 1ff9a82

Browse files
committed
use shorter file path in debug trace
1 parent ec4260f commit 1ff9a82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ module.exports = function (content) {
6363

6464
var context = (this._compiler && this._compiler.context) || this.options.context || process.cwd()
6565
var moduleId = 'data-v-' + genId(filePath, context, options.hashKey)
66+
var shortFilePath = path.relative(context, filePath).replace(/^(\.\.\/)+/, '')
6667

6768
var cssLoaderOptions = ''
6869
if (!isProduction && this.sourceMap && options.cssSourceMap !== false) {
@@ -470,7 +471,7 @@ module.exports = function (content) {
470471
// development-only code
471472
if (!isProduction) {
472473
// add filename in dev
473-
output += 'Component.options.__file = ' + JSON.stringify(filePath) + '\n'
474+
output += 'Component.options.__file = ' + JSON.stringify(shortFilePath) + '\n'
474475
// check named exports
475476
output +=
476477
'if (Component.esModule && Object.keys(Component.esModule).some(function (key) {' +

0 commit comments

Comments
 (0)