Skip to content

Remove CJS exports, go full ESM only#902

Open
daniel-heppner-ibigroup wants to merge 13 commits into
opentripplanner:masterfrom
ibi-group:esm-only
Open

Remove CJS exports, go full ESM only#902
daniel-heppner-ibigroup wants to merge 13 commits into
opentripplanner:masterfrom
ibi-group:esm-only

Conversation

@daniel-heppner-ibigroup
Copy link
Copy Markdown
Contributor

This is a major breaking change, it removes CJS exports and goes full ESM only.

I also moved the export to /dist, which is the standard output directory for build artifacts in npm. This could cause problems for anyone using a hack to import files from inside the packages.

@daniel-heppner-ibigroup
Copy link
Copy Markdown
Contributor Author

So what's going on with the snapshot changes? From what I can tell the changes are 100% styled component classnames. Styled components is super annoying because the classnames are generated by a babel plugin that uses a hashing function on a bunch of inputs, including the file path that is given to it by vite. Apparently Vite does some optimization step in a random directory, and although it's not supposed to happen on monorepo packages, it doesn't correctly exclude ours since pnpm symlinks them into node_modules. So manually adding all our monorepo packages to the exclude list in storybook's main.js ensures that these files have a constant path for styled components.

@miles-grant-ibigroup miles-grant-ibigroup removed their assignment Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants