-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Modify build process to disable code splitting #4334
Conversation
@@ -38,7 +38,7 @@ const config: Options = { | |||
|
|||
// Split the output into chunks. This is useful for tree-shaking. | |||
// https://tsup.egoist.dev/#code-splitting | |||
splitting: true, | |||
splitting: false, |
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.
This is the actual configuration change which disables the code splitting
/ "chunking" feature.
296ee53
to
2255fa3
Compare
@metamaskbot publish-previews |
@metamaskbot publish-preview |
2255fa3
to
c0fbe32
Compare
@metamaskbot publish-previews |
The repo is in a state of limbo currently because of a failed release. Once that gets resolved then I'll try creating preview builds again. |
The code splitting feature in `tsup` breaks up source code into logical modules so that if a module is not being used it can be removed by a build tool that supports tree shaking. However, the modules that `tsup` creates do not necessary match the files in the original source code, and `tsup` gives them a random name. This makes it frustrating for developers on a client team who are debugging a `core` package by inspecting the compiled version, because it is impossible to tell what a chunk file contains without first opening it up. This commit thus configures `tsup` to disable the code splitting feature.
7676d52
to
f7a7123
Compare
I am going to close this PR, as we need code splitting for Snaps. |
Explanation
The code splitting feature in
tsup
breaks up source code into logical modules so that if a module is not being used it can be removed by a build tool that supports tree shaking.However, the modules that
tsup
creates do not necessary match the files in the original source code, andtsup
gives them a random name. This makes it frustrating for developers on a client team who are debugging acore
package by inspecting the compiled version, because it is impossible to tell what a chunk file contains without first opening it up.This commit thus configures
tsup
to disable the code splitting feature.References
Fixes #4333.
Testing
yarn build
.dist
directory for a package such aspackages/assets-controllers
.chunk-XXXX.js
orchunk-XXXX.mjs
.Changelog
(Updated in PR.)
Checklist