Skip to content

Commit

Permalink
workaround bug in commonjs creating broken transpiled JS when an expo…
Browse files Browse the repository at this point in the history
…rt is found inside a string (like an error message)
  • Loading branch information
diosmosis committed Jul 28, 2024
1 parent 737d231 commit 3480aac
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ export default {
name: 'MatomoLookerStudio',
},
plugins: [
{
transform(code, id) {
// the commonjs rollup plugin does not handle export statements in strings well
if (/\/mathjs\//.test(id)) {
code = code.replace('export const path = "expression.transform"', '');
}
return code;
},
},
commonjs(),
nodeResolve(),
typescript(),
Expand Down

0 comments on commit 3480aac

Please sign in to comment.