diff --git a/lib/index.js b/lib/index.js index b3a09f626..d5b67179e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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` diff --git a/test/advanced.spec.js b/test/advanced.spec.js index f7b3f5869..138a7b47d 100644 --- a/test/advanced.spec.js +++ b/test/advanced.spec.js @@ -1,4 +1,3 @@ -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() }) })