Skip to content

Commit

Permalink
fix: dedup assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean authored and CGNonofr committed Jan 4, 2024
1 parent ef68d97 commit 85847e0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rollup/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ export default (args: Record<string, string>): rollup.RollupOptions[] => {
}
}]
})
await groupBundle.write({
const output = await groupBundle.write({
preserveModules: true,
preserveModulesRoot: path.resolve(DIST_DIR, 'main/service-override'),
minifyInternalExports: false,
Expand All @@ -1087,6 +1087,13 @@ export default (args: Record<string, string>): 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]
}
}
}
}), {
Expand Down

0 comments on commit 85847e0

Please sign in to comment.