-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
output.entryFileNames - accept a function? #2585
Comments
This is definitely doable but might take some time. Note that you can already achieve the same (though maybe not as elegantly) today by using the object form of
|
The same feature would solve a slightly different use-case: Most names should feature a |
Hey folks. This is a saved-form message, but rest assured we mean every word. The Rollup team is attempting to clean up the Issues backlog in the hopes that the active and still-needed, still-relevant issues bubble up to the surface. With that, we're closing issues that have been open for an eon or two, and have gone stale like pirate hard-tack without activity. We really appreciate the folks have taken the time to open and comment on this issue. Please don't confuse this closure with us not caring or dismissing your issue, feature request, discussion, or report. The issue will still be here, just in a closed state. If the issue pertains to a bug, please re-test for the bug on the latest version of Rollup and if present, please tag @shellscape and request a re-open, and we'll be happy to oblige. |
For me, making the file name output properties functions is definitely a desirable feature which could also solve some other issues. Reopening it to track this. |
@lukastaegert I'd like to tackle this one but I'll need some direction on when and where the function should be called. I've tracked down where the options are fetched from config, but unsure on the best place to call the fn. Is We're also going to get requests for |
I would not go for async functions unless there is actual demand. Also there are hardly any places in the user facing options where you can do something async. Also I think this should make all three As for the right place, yes, |
I did implement it in #3658 and added a test it works also with assets and all other filds that support a pattern. |
…aces where you could use a pattern string before (#3658) * # Das ist eine Kombination aus 4 Commits. # Das ist die erste Commit-Beschreibung: #2585 # Das ist Commit-Beschreibung #2: Better Implementation now with a test # Das ist Commit-Beschreibung #3: Add: Tests # Das ist Commit-Beschreibung #4: Fix: License * #2585 Better Implementation now with a test Add: Tests Fix: License Now passing a object { replacements, meta() } Add: docs and renamed property * Corrected types * add: test * Upgraded test to include a chunk via dynamic import * Fix: solo test * Refine interfaces, types, docs and test * Further refine docs Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Feature Use Case
Is it possible for
entryFileNames
option to accept a function in addition to a string?For background context, this is what my rollup.config.js looks like:
The default
[name].js
value for output.entryFileNames field this leads to a dist folder which contains the majority of the components necessary, except for those like Dropdown, SomethingElse, etc. the ones inside their own folders. However, they do appear inside files named likeindex.js
,index1.js
,index2.js
, etc.What can be done to make Rollup create output files like
Dropdown.js
andSomethingElse.js
instead ofindex.js
andindex.1.js
?Feature Proposal
If
entryFileNames
accepted a function, that would address this issue because I could then write something likeThe text was updated successfully, but these errors were encountered: