-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feature Request: Merge small chunks into one chuck; having a capability to configure #3828
Comments
Merging chunks is supported by Rollup, however this is not always safe to do so. For example: // shared.js
export let util = 1
// a.js (entry)
import { util } from './shared.js'
import b from './b.js'
foo(b, util)
// b.js (entry)
import { util } from './shared.js'
export default bar(util) If merging // dist/a.js (a shared)
export let util = 1
import b from './b.js' // a -> b
foo(b, util)
// dist/b.js (b)
import { util } from './a.js' // b -> a
export default bar(util) …which seems ok on a quick look. However it causes different behavior from the original code: On the other hand, chunk splitting is also not very safe since common chunks may be executed in unwanted order. 🤷 |
Description
Currently, when exporting constants or any file which a multiple exports in our project, each export generates a separate chunk during the build process. For example, a file like
global.constants.ts
with exports such as:The text was updated successfully, but these errors were encountered: