Skip to content

Commit

Permalink
prevent rollup from adding [Symbol.toStringTag]: 'Module' to CJS files
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Oct 25, 2022
1 parent fe1a22c commit 26bc18b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rollup/npmHelpers.js
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 XXXXX.)
generatedCode: {
preset: 'es2015',
symbols: false,
},

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

0 comments on commit 26bc18b

Please sign in to comment.