-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add option to customize asset file names #41
Conversation
Codecov Report
@@ Coverage Diff @@
## main #41 +/- ##
==========================================
+ Coverage 79.70% 81.81% +2.11%
==========================================
Files 8 8
Lines 547 572 +25
Branches 32 46 +14
==========================================
+ Hits 436 468 +32
+ Misses 79 58 -21
- Partials 32 46 +14
|
* Similar to `output.assetFileNames` in rollup config, | ||
* but if returns undefined, then this config defaults is be used. | ||
* | ||
* @example Move CSS styles to `styles/style.css` instead of the default `css/[entrypoint-name].css`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not a good example as you will have to set cssCodeSplit
to false. Otherwise the styles would override each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example was based on nextcloud/password-confirmation
, where currently styles are renamed manually by adding && mv ./dist/main.css ./dist/style.css
(only in a production build, dev build just doesn't work).
There is no cssCodeSplit
and this custom function works.
But there is only one entrypoint
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
ff76547
to
b1e4978
Compare
Resolves
mergeConfigs
doesn't work forbuild.rollupOptions.output[].assetFileNames()
:output
arrays and results in both default and newassetFileNames
, duplicating assetsappConfig.ts
values, requiring to override all cases, not only one specific, or duplicate this config defaults.This PR adds new option
assetFileNames
to manually merge customassetFileNames
with the default. If custom one returnsundefiend
(falsy), then the default one is used.Example
If a lib has styles and its entrypoint is
main.ts
, then styles are built tomain.css
and it is not possible to change.@susnux If this options is fine, what do you think about adding the same for chunk file names to not more everything to one folder?