You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some bundlers, especially older ones, don't support resolving `.mjs`
files out of the box. To retain compatibility with these bundlers
without requiring users to adjust their configurations, we need to keep
all our ESM output as `.js` files.
So node.js loads these as modules, we output a `package.json` into each
`./build/esm` output directory containing simply `{ "type": "module" }`.
This works because whenever node.js is asked to load a `.js` file, it
tries to work out whether this is CJS or ESM by searching up through
parent directories until it finds a `package.json` with the `type` set.
This PR:
- Adds a Rollup plugin that injects the `package.json` into the ESM
output
- Adds the package `exports` that @AbhiPrasad worked out for #10833
- Fixes an import issue with `next/router` which is CJS (at least in
v10)
- Fixes an import issue with `@prisma/instrumentation` which is CJS
- Ensures that CJS only integrations are not included in the
`@sentry/node` default integrations when running as ESM
This PR also makes some unrelated changes:
- Changes to the old Node SDKs to allow the tests to pass
- Removes the bundle size analysis CI job as it doesn't appears to be
compatible with the node ESM output
0 commit comments