From 85847e0e53274f874c44c593503d2ff6bbb0c4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 12 Dec 2023 00:48:09 +0100 Subject: [PATCH] fix: dedup assets --- rollup/rollup.config.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index ffd6045f..4b73b18f 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -1070,7 +1070,7 @@ export default (args: Record): rollup.RollupOptions[] => { } }] }) - await groupBundle.write({ + const output = await groupBundle.write({ preserveModules: true, preserveModulesRoot: path.resolve(DIST_DIR, 'main/service-override'), minifyInternalExports: false, @@ -1087,6 +1087,13 @@ export default (args: Record): rollup.RollupOptions[] => { for (const exclusiveModule of exclusiveModules) { delete bundle[path.relative(DIST_DIR_MAIN, exclusiveModule)] } + + const assets = output.output + .filter((file): file is rollup.OutputAsset => file.type === 'asset') + .filter(file => file.fileName !== 'package.json') + for (const asset of assets) { + delete bundle[asset.fileName] + } } } }), {