Skip to content

Commit

Permalink
fix: Do not mangle _meta.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Oct 10, 2024
1 parent 3e6d404 commit 9e94145
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions packages/sdk/browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ const getSharedConfig = (format, file) => ({
},
});

const terserOpts = {
mangle: {
properties: {
regex: /^_/,
reserved: ['_meta']
},
}
};

export default [
{
...getSharedConfig('es', 'dist/index.es.js'),
Expand All @@ -33,13 +42,7 @@ export default [
esmExternals: true,
}),
resolve(),
terser({
mangle: {
properties: {
regex: /^_/,
},
},
}),
terser(terserOpts),
json(),
// The 'sourcemap' option allows using the minified size, not the size before minification.
visualizer({ sourcemap: true }),
Expand All @@ -51,13 +54,7 @@ export default [
typescript(),
common(),
resolve(),
terser({
mangle: {
properties: {
regex: /^_/,
},
},
}),
terser(terserOpts),
json(),
],
},
Expand Down

0 comments on commit 9e94145

Please sign in to comment.