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( ...@@ -177,7 +177,7 @@ var component = normalizer(
? JSON.stringify(filename) ? JSON.stringify(filename)
// Expose the file's full path in development, so that it can be opened // Expose the file's full path in development, so that it can be opened
// from the devtools. // from the devtools.
: JSON.stringify(rawShortFilePath) : JSON.stringify(rawShortFilePath.replace(/\\/g, '/'))
}` }`
code += `\nexport default component.exports` code += `\nexport default component.exports`
......
const path = require('path')
const { SourceMapConsumer } = require('source-map') const { SourceMapConsumer } = require('source-map')
const normalizeNewline = require('normalize-newline') const normalizeNewline = require('normalize-newline')
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin')
...@@ -50,7 +49,7 @@ test('expose file path as __file outside production', done => { ...@@ -50,7 +49,7 @@ test('expose file path as __file outside production', done => {
mockBundleAndRun({ mockBundleAndRun({
entry: 'basic.vue' entry: 'basic.vue'
}, ({ module }) => { }, ({ module }) => {
expect(module.__file).toBe(path.normalize('test/fixtures/basic.vue')) expect(module.__file).toBe('test/fixtures/basic.vue')
done() 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