-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add option to configure if entry signatures are preserved #3498
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
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3498 +/- ##
==========================================
+ Coverage 96.08% 96.12% +0.03%
==========================================
Files 175 176 +1
Lines 5956 5983 +27
Branches 1752 1761 +9
==========================================
+ Hits 5723 5751 +28
Misses 118 118
+ Partials 115 114 -1
Continue to review full report at Codecov.
|
57d8d99 to
9199d6d
Compare
9199d6d to
6fadc58
Compare
…ser-defined chunk and preserveEntrySignatures has not been set
61f9449 to
f9b277d
Compare
f9b277d to
0a9ce4d
Compare
0dcf873 to
2713c6d
Compare
2713c6d to
6d27557
Compare
|
I tried this out on a few different projects, and it's working as expected. 👍 |
|
This is now ready from my side, will probably release it tomorrow. |
* Refactor some code * Implement support for preserveEntrySignatures false and 'allow-extension' * Throw an error if preserveEntrySignatures is set to false for preserveModules * Add basic documentation * Show a meaningful warning if an empty facade chunk is created for a user-defined chunk and preserveEntrySignatures has not been set * Make config file watching more stable * Add ability to override signature preservation for plugins * Extend documentation * Try to improve watch test stability * Add option to control minification of internal exports
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3358
Description
This will add a new input option
preserveEntrySignaturesthat will configure if facades are created or otherwise how freely entry point exports can be created. Possible values:"strict": This corresponds to the current behaviour. Entry chunks will expose exactly the exports of the corresponding entry modules. If this is not possible because additional bindings need to be exported from the chunk, a facade chunk will be created. This is the default and is the recommended setting for libraries."allow-extension": Entry chunks will expose all exports of the corresponding entry modules. If additional bindings need to be exported as well for some other chunk, they will be added to the entry chunk and extend the signature. If exports are minified, those additional exports will be minified. This settings can be used for libraries if less chunks are desired and a strict facade is not required.false: By default, not exports will be exposed by entry chunks, and exported variables will only be included in the bundle if they are actually used by the code. If bindings need to be exported for some other chunk, they will be added just as if this were an internal chunk. This is the recommended setting if the entry points are to be put into script tags.When emitting chunks via
this.emitFilein the plugin API, it is possible to override this setting for individual chunks by supply a newpreserveSignatureoption with the same values.Additionally, this adds an option
minifyInternalExports: true|falsethat allows to control for all formats if internal exports are minified to single-letter names.There are still some things to do:
preserveModules. By default, I would throw an error iffalseis used withpreserveModulesfor now.