Skip to content

Commit f6fc40b

Browse files
authored
fix: Do not mangle _meta. (#622)
1 parent 3e6d404 commit f6fc40b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

packages/sdk/browser/rollup.config.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ const getSharedConfig = (format, file) => ({
2121
},
2222
});
2323

24+
const terserOpts = {
25+
mangle: {
26+
properties: {
27+
// Mangle class properties which start with an underscore.
28+
regex: /^_/,
29+
// Do not mangle '_meta', because this is part of our JSON
30+
// data model.
31+
reserved: ['_meta']
32+
},
33+
}
34+
};
35+
2436
export default [
2537
{
2638
...getSharedConfig('es', 'dist/index.es.js'),
@@ -33,13 +45,7 @@ export default [
3345
esmExternals: true,
3446
}),
3547
resolve(),
36-
terser({
37-
mangle: {
38-
properties: {
39-
regex: /^_/,
40-
},
41-
},
42-
}),
48+
terser(terserOpts),
4349
json(),
4450
// The 'sourcemap' option allows using the minified size, not the size before minification.
4551
visualizer({ sourcemap: true }),
@@ -51,13 +57,7 @@ export default [
5157
typescript(),
5258
common(),
5359
resolve(),
54-
terser({
55-
mangle: {
56-
properties: {
57-
regex: /^_/,
58-
},
59-
},
60-
}),
60+
terser(terserOpts),
6161
json(),
6262
],
6363
},

0 commit comments

Comments
 (0)