From 852ff909c58d9f27e0157d9d8afcd7f37d79317a Mon Sep 17 00:00:00 2001 From: sharkykh Date: Wed, 8 Aug 2018 01:42:31 +0300 Subject: [PATCH 1/2] Fix inconsistent path between Windows and POSIX systems --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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` From f3020adecf432a8e0ecd04462db1eeefb1a9bb2d Mon Sep 17 00:00:00 2001 From: sharkykh Date: Sat, 18 Aug 2018 17:56:03 +0300 Subject: [PATCH 2/2] Fix test --- test/advanced.spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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() }) })