Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74a7dbd

Browse filesBrowse files
sharkykhyyx990803
authored andcommitted
fix: fix inconsistent path between Windows and POSIX systems (‏ (vuejs#1384
* Fix inconsistent path between Windows and POSIX systems * Fix test
1 parent 0c2da0f commit 74a7dbd
Copy full SHA for 74a7dbd

File tree

Expand file treeCollapse file tree

2 files changed

+2
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-3
lines changed

‎lib/index.js

Copy file name to clipboardExpand all lines: lib/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ var component = normalizer(
177177
? JSON.stringify(filename)
178178
// Expose the file's full path in development, so that it can be opened
179179
// from the devtools.
180-
: JSON.stringify(rawShortFilePath)
180+
: JSON.stringify(rawShortFilePath.replace(/\\/g, '/'))
181181
}`
182182

183183
code += `\nexport default component.exports`

‎test/advanced.spec.js

Copy file name to clipboardExpand all lines: test/advanced.spec.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const path = require('path')
21
const { SourceMapConsumer } = require('source-map')
32
const normalizeNewline = require('normalize-newline')
43
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
@@ -50,7 +49,7 @@ test('expose file path as __file outside production', done => {
5049
mockBundleAndRun({
5150
entry: 'basic.vue'
5251
}, ({ module }) => {
53-
expect(module.__file).toBe(path.normalize('test/fixtures/basic.vue'))
52+
expect(module.__file).toBe('test/fixtures/basic.vue')
5453
done()
5554
})
5655
})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.