Commit 74a7dbd8 authored by sharkykh's avatar sharkykh Committed by Evan You

fix: fix inconsistent path between Windows and POSIX systems (‏ (#1384

* Fix inconsistent path between Windows and POSIX systems

* Fix test
parent 0c2da0f5
......@@ -177,7 +177,7 @@ var component = normalizer(
? JSON.stringify(filename)
// Expose the file's full path in development, so that it can be opened
// from the devtools.
: JSON.stringify(rawShortFilePath)
: JSON.stringify(rawShortFilePath.replace(/\\/g, '/'))
}`
code += `\nexport default component.exports`
......
const path = require('path')
const { SourceMapConsumer } = require('source-map')
const normalizeNewline = require('normalize-newline')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
......@@ -50,7 +49,7 @@ test('expose file path as __file outside production', done => {
mockBundleAndRun({
entry: 'basic.vue'
}, ({ module }) => {
expect(module.__file).toBe(path.normalize('test/fixtures/basic.vue'))
expect(module.__file).toBe('test/fixtures/basic.vue')
done()
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment