diff --git a/packages/utils/src/resolve.js b/packages/utils/src/resolve.js index 09972caa837b..79d43f516af0 100644 --- a/packages/utils/src/resolve.js +++ b/packages/utils/src/resolve.js @@ -18,10 +18,9 @@ export const wp = function wp (p = '') { } export const wChunk = function wChunk (p = '') { - if (isWindows) { - return p.replace(/\//g, '_') - } - return p + // workaround for SplitChunksPlugin that generate names starting from . for catchAll pages _.vue + // consider using https://webpack.js.org/configuration/output/#outputfilename for more robust control over filename generation + return p.replace('_', '[_]') } const reqSep = /\//g diff --git a/packages/utils/test/resolve.win.test.js b/packages/utils/test/resolve.win.test.js index 3feb80b84dc1..768e26a5aa36 100644 --- a/packages/utils/test/resolve.win.test.js +++ b/packages/utils/test/resolve.win.test.js @@ -12,7 +12,7 @@ describe.win('util: resolve windows', () => { }) test('should format windows path', () => { - expect(wChunk('nuxt/layout/test')).toEqual('nuxt_layout_test') + expect(wChunk('nuxt/layout/test')).toEqual('nuxt/layout/test') }) test('should resolve alias path', () => { diff --git a/test/dev/extract-css.test.js b/test/dev/extract-css.test.js index a507c69a3714..bb6086f3c980 100644 --- a/test/dev/extract-css.test.js +++ b/test/dev/extract-css.test.js @@ -5,7 +5,6 @@ import { loadFixture, getPort, Nuxt } from '../utils' let nuxt = null const readFile = promisify(fs.readFile) -const isWindows = process.platform.startsWith('win') describe('extract css', () => { beforeAll(async () => { @@ -17,7 +16,7 @@ describe('extract css', () => { }) test('Verify global.css has been extracted and minified', async () => { - const fileName = isWindows ? 'pages_index.css' : 'pages/index.css' + const fileName = 'pages/index.css' const extractedIndexCss = resolve(__dirname, '..', 'fixtures/extract-css/.nuxt/dist/client', fileName) const content = await readFile(extractedIndexCss, 'utf-8')