Description
First, mozilla/source-map doesn't support \
as separator at all, because it's designed to be consumed in browser.
- the
file
andsourceRoot
has to be normalized.
component-compiler-utils/lib/parse.ts
Lines 91 to 93 in 8de35e6
{
file: filename.replace(/\\/g, '/'),
sourceRoot: sourceRoot.replace(/\\/g, '/')
}
There is one more to be fixed in @vue/component-compiler
.
https://github.com/vuejs/vue-component-compiler/blob/afa1cd440123e2e0c195908c1e15935273ac64a9/src/assembler.ts#L77
- actually the default
sourceRoot
doesn't make much sense, because when serving the source-map to browser,process.cwd()
is irrelevant.
component-compiler-utils/lib/parse.ts
Line 52 in 8de35e6
Change to
sourceRoot = '',
With the above two fixes, it can fix https://travis-ci.org/dumberjs/gulp-vue-file/builds/477568946
Update: I managed to fix the gulp-vue-file bug within gulp-vue-file by rewriting sourcemaps (normalize sources and file path). But the incoming sourcemaps should also be fixed in vue compiler.
Let me know what you think, I can make some PRs for this.