Open AbhiPrasad opened 2 months ago
This eliminates 5 deps / 225 KB from the dep tree of the SDK: https://npmgraph.js.org/?q=resolve
Looks like this does need esm resolution support!
We might need https://github.com/unjs/mlly instead
just a heads up @AbhiPrasad, mlly
has a relatively similar dep graph and size to resolve
.
5 deps: https://npmgraph.js.org/?q=mlly 232 kB: https://www.npmjs.com/package/mlly/v/1.7.1?activeTab=readme
Problem Statement
https://github.com/getsentry/sentry-javascript/blob/354977792e78789fc2823a169b95cd11e55b4c35/packages/nextjs/package.json#L83
The SDK requires Node
14.18+
as per https://github.com/getsentry/sentry-javascript/blob/354977792e78789fc2823a169b95cd11e55b4c35/packages/nextjs/package.json#L10This means we can replace
resolve
library with native Node.js usage.Solution Brainstorm
~Instead of using resolve, we can use
import { createRequire } from 'module';
. This is fine because we only need CJS resolution here.~~See https://github.com/rollup/plugins/pull/1742 as an example PR doing this.~