feat(multi-entry): add preserveModules option - #1237
Conversation
…e = true BREAKING CHANGES: Changes the default behaviour to not alter filenames if preserveModules=true
|
Edit: Tests have been run now |
|
I am open to other suggestions on how to solve this, one being allowing |
|
@shellscape not to be a pain but could I bug you to have a look at this I'm very flexible on the implementation here Really I just need a method to make sure the plugin doesn't always use the default entry filename so that I can use rollups default behaviour with preserveModules and this plugin together |
|
I generally don't have much stake in this plugin. Please check out the history and which maintainers have contributed to it in the past for their feedback. |
|
@shellscape will do thanks for replying so quickly |
|
Hello @guybedford @NotWoods sorry to drag you guys in here randomly As stated before I'm pretty flexible on implementation here |
|
Since the other two maintainers are quiet at the moment, I'll chime in to try and get this moving forward. I generally don't like to merge breaking changes unless there's a large, community-wide reason to do so. That said, I think you could add another option such as |
|
Thanks @shellscape I'll update the pr when I have time and tag you when its done |
|
@shellscape all updated to use a new config option instead I've also updated the pr title to hopefully match the required format, though tbh I'm not totally aware of what the required format is... either way, look forward to hearing from you :) |
|
The change looks good now. We're going to be blocked from merging until #1270 lands (sorry about that). One thing to do in the mean time is to update the README with the new option. |
|
Sorry about the delay myself, README is updated :) |
|
Hey @shellscape I noticed there were some pr conflicts so I've gone through and fixed them up Thanks! |
b353836 to
3038271
Compare

Rollup Plugin Name:
@rollup/plugin-multi-entryThis PR contains:
Probably somewhere in the grey area of a bugfix and a feature
Are tests included?
Breaking Changes?
Its "kind of" a breaking change? Breaking in the fact that people who use this plugin with preserveModules=true will experience a change by upgrading, however the change will be probably an outcome that they would expect from this plugin when using preverveModules=true
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
When preserveModules is set on the output, its expected that the filenames and structure will not be altered.
This library is always setting the files names to be
multi-entry.jsand if there are multiple it ismulti-entry1.jsand so on.My desired out come is that I can use the multi-entry plugin to target all src files within my project to be built so when using the library I can easily do
import { ExampleComponent } from 'example-library/nested-directory/exampleComponent';when the src file structure is:
example-library -> src -> nested-directory -> exampleComponent.js