Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack is using cjs files instead of esm #397

Open
seanparmelee opened this issue Jun 23, 2022 · 1 comment
Open

Webpack is using cjs files instead of esm #397

seanparmelee opened this issue Jun 23, 2022 · 1 comment
Assignees

Comments

@seanparmelee
Copy link

seanparmelee commented Jun 23, 2022

For context, I'm using NextJS and following the instructions here to instrument the @splunk/otel-web package. While using @next/bundle-analyzer, I noticed that the @splunk/otel-web/dist/cjs files are being pulled in. I was hoping to see the @splunk/otel-web/dist/esm files being used so that Webpack can tree shake off the modules that @splunk/otel-web is not using.

It looks like the reason the CJS files are being used is because Webpack checks the browser field of the package.json first by default and currently it contains:

  "browser": "dist/cjs/index.js",
  "module": "dist/esm/index.js",

I was wondering if the team would be open to:

I'm happy to open a PR.

@jtmal-signalfx
Copy link
Contributor

We talked about this offline, but I still think we want to fix this issue. I'll add it to our internal backlog.

@jtmal-signalfx jtmal-signalfx self-assigned this Aug 10, 2022
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

No branches or pull requests

2 participants