Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 25f7beb

Browse files
committed
fix: normalize source map file path on windows
Updated test snapshot file. 1. Sources paths was cleaned up by upgrading component-compiler-utils. 2. Styles mapping changes are due to newer version of postcss (from component-compiler-utils). 3. postcss rawResult is removed. * The rawResult contains ast tree which postcss always prepends current working directory to referencing file name. * This is a main pain point of maintaining this snapshot test. * The correctness of rawResult is responsibility of postcss, not vue compiler. So it's irrelevant to test it here. This is a companion PR for vuejs/component-compiler-utils#51
1 parent a86c90d commit 25f7beb

File tree

5 files changed

+38
-1063
lines changed

5 files changed

+38
-1063
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"vue-template-compiler": "*"
5858
},
5959
"dependencies": {
60-
"@vue/component-compiler-utils": "^2.5.0",
60+
"@vue/component-compiler-utils": "^2.5.2",
6161
"clean-css": "^4.1.11",
6262
"hash-sum": "^1.0.2",
6363
"postcss-modules-sync": "^1.0.0",

src/assembler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function assembleFromSource(
7474
script = script || { source: 'export default {}' }
7575
template = template || { source: '' }
7676
let map = undefined
77-
const mapGenerator = new SourceMapGenerator({ file: filename })
77+
const mapGenerator = new SourceMapGenerator({ file: filename.replace(/\\/g, '/') })
7878

7979
const hasScopedStyle = styles.some(style => style.scoped === true)
8080
const hasStyle = styles.some(style => style.source || style.module)

0 commit comments

Comments
 (0)