There may be optimization wins in getting rid of all re-exports from our bundles. i.e. import from re-exports in our own code only, leave the re-exports in place for public API.
export * as x from '...'
export * from '...'
import x from '...'
export { x }
import x from '...'
export default x
We could start an effort to build a post transformation optimization step which can take the module graph into account for cross-file optimizations. Is rollup with preserveModules already capable of this?
See also: mui/base-ui#5248 (comment)
The drawback with this is that it's very invisible in terms of introspection while it could be solved in source code. Alternatively: solve in the source code and build a module graph lint tool that can reject importing re-exports.
There may be optimization wins in getting rid of all re-exports from our bundles. i.e. import from re-exports in our own code only, leave the re-exports in place for public API.
We could start an effort to build a post transformation optimization step which can take the module graph into account for cross-file optimizations. Is
rollupwithpreserveModulesalready capable of this?See also: mui/base-ui#5248 (comment)
The drawback with this is that it's very invisible in terms of introspection while it could be solved in source code. Alternatively: solve in the source code and build a module graph lint tool that can reject importing re-exports.