diff --git a/src/index.js b/src/index.js index 040a5877..7c38ee1a 100644 --- a/src/index.js +++ b/src/index.js @@ -171,9 +171,10 @@ export default (options = {}) => { const concat = new Concat(true, fileName, '\n') const entries = [...extracted.values()] + const relativePath = path.relative(dir, file) const { modules, facadeModuleId } = bundle[ - normalizePath(path.relative(dir, file)) - ] + normalizePath(relativePath) + ] || bundle[relativePath] if (modules) { const moduleIds = getRecursiveImportOrder( diff --git a/test/index.test.js b/test/index.test.js index 0ee03c9a..05e65db5 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -454,3 +454,18 @@ test('augmentChunkHash', async () => { const barHash = barOne.fileName.split('.')[1] expect(barHash).not.toEqual(fooHash) // Verify that foo and bar does not hash to the same }) + +test('backslashEntryFilename', async () => { + const outDir = fixture('dist', 'backslashEntryFilename') + const file = 'simple/foo.css' + const newBundle = await rollup({ + input: fixture(file), + plugins: [postcss({ extract: true })] + }) + const { output } = await newBundle.write({ + dir: outDir, + entryFileNames: 'test\\foo.[hash].css' + }) + const hash = output[0].fileName.split('.')[1] + expect(hash).toBeTruthy() // Verify that [hash] part of `foo.[hash].css` is truthy +})