Skip to content

Commit

Permalink
fix(lib): Include hash in assets name
Browse files Browse the repository at this point in the history
When using css inlining and multiple output formats (e.g. esm and cjs) the assets order is not deterministic.
This causes issues if the assets are named the same, e.g. if you have multiple "index" entry points the assets will be called index1, index2...
So when not using hashes the last output format might override the assets with a changed order, causing the previous output formats to be invalid.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Sep 16, 2023
1 parent a3a3245 commit 8f07cbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const createLibConfig = (entries: { [entryAlias: string]: string }, optio
if (!options.inlineCSS && /css/i.test(extType)) {
return '[name].css'
}
return 'assets/[name][extname]'
return 'assets/[name]-[hash][extname]'
}

// Manually define output options for file extensions
Expand Down

0 comments on commit 8f07cbe

Please sign in to comment.