We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f74f5b commit a1a02baCopy full SHA for a1a02ba
plugins/zip.ts
@@ -28,7 +28,13 @@ export const zip = (zipOption: ZipOption = {}): Plugin => {
28
async closeBundle() {
29
const zip = new JSZIP();
30
for await (const fp of walk(`dist`)) {
31
- zip.file(fp.substring(5), fs.readFile(fp));
+ /**
32
+ * must use .replaceAll('\\\\', '/')
33
+ *
34
+ * 
35
+ */
36
+ const pathname = fp.substring(`dist/`.length).replaceAll(`\\`, `/`);
37
+ zip.file(pathname, fs.readFile(fp));
38
}
39
const bf = await zip.generateAsync({ type: 'nodebuffer' });
40
fs.writeFile(`dist.zip`, bf);
0 commit comments