Modify build process to disable code splitting
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, 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.
References
Fixes #4333.
Testing
- Run
yarn build. - Open up the
distdirectory for a package such aspackages/assets-controllers. - You shouldn't see any files named
chunk-XXXX.jsorchunk-XXXX.mjs.
Changelog
(Updated in PR.)
Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
@metamaskbot publish-previews
@metamaskbot publish-preview
@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.
I am going to close this PR, as we need code splitting for Snaps. ts-bridge is close to supporting monorepos anyway.