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

fix(build): Prevent Rollup from adding [Symbol.toStringTag]: 'Module' to CJS files #6043

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions rollup/npmHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ export function makeBaseNPMConfig(options = {}) {
// output individual files rather than one big bundle
preserveModules: true,

// any wrappers or helper functions generated by rollup can use ES6 features
generatedCode: 'es2015',
// Allow wrappers or helper functions generated by rollup to use any ES6 features except symbols. (Symbols in
// general are fine, but the `[Symbol.toStringTag]: 'Module'` which Rollup adds alongside `__esModule:
// true` in CJS modules makes it so that Jest <= 29.2.2 crashes when trying to mock generated `@sentry/xxx`
// packages. See https://github.com/getsentry/sentry-javascript/pull/6043.)
generatedCode: {
preset: 'es2015',
symbols: false,
},

// don't add `"use strict"` to the top of cjs files
strict: false,
Expand Down