Skip to content

Commit

Permalink
feat(rollup): use hashed chunk names
Browse files Browse the repository at this point in the history
rollup picks a random module [name] which was making confusing names
  • Loading branch information
pi0 committed Aug 10, 2022
1 parent c3979ab commit 850b013
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/builder/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function getRollupOptions (ctx: BuildContext): RollupOptions {
ctx.options.rollup.emitCJS && {
dir: resolve(ctx.options.rootDir, ctx.options.outDir),
entryFileNames: '[name].cjs',
chunkFileNames: 'chunks/[name].cjs',
chunkFileNames: `chunks/${ctx.options.name}.[hash].cjs`,
format: 'cjs',
exports: 'auto',
preferConst: true,
Expand All @@ -145,7 +145,7 @@ export function getRollupOptions (ctx: BuildContext): RollupOptions {
{
dir: resolve(ctx.options.rootDir, ctx.options.outDir),
entryFileNames: '[name].mjs',
chunkFileNames: 'chunks/[name].mjs',
chunkFileNames: `chunks/${ctx.options.name}.[hash].mjs`,
format: 'esm',
exports: 'auto',
preferConst: true,
Expand Down

0 comments on commit 850b013

Please sign in to comment.