Skip to content

build tooling: resolve re-exports #1673

Description

@Janpot

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.

Metadata

Metadata

Assignees

Labels

scope: code-infraInvolves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).status: waiting for maintainerThese issues haven't been looked at yet by a maintainer.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions