Skip to content

Commit 87ce8e0

Browse files
committed
Use esbuild options which removes dependence on rollup and terser.
1 parent 8067c05 commit 87ce8e0

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

packages/sdk/browser/tsup.config.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,21 @@ export default defineConfig({
77
index: 'src/index.ts',
88
compat: 'src/compat/index.ts'
99
},
10-
minify: 'terser',
11-
terserOptions: {
12-
mangle: {
13-
properties: {
14-
// Mangle class properties which start with an underscore.
15-
regex: /^_/,
16-
// Do not mangle '_meta', because this is part of our JSON
17-
// data model.
18-
reserved: ['_meta'],
19-
},
20-
},
21-
},
10+
minify: true,
2211
format: ['esm', 'cjs'],
2312
splitting: false,
2413
sourcemap: false,
2514
clean: true,
2615
noExternal: ['@launchdarkly/js-sdk-common', '@launchdarkly/js-client-sdk-common'],
27-
treeshake: true,
2816
dts: true,
17+
metafile: true,
18+
minifyIdentifiers: true,
19+
esbuildOptions(opts) {
20+
// This would normally be `^_(?!meta|_)`, but go doesn't support negative look-ahead assertions,
21+
// so we need to craft something that works without it.
22+
// So start of line followed by a character that isn't followed by m or underscore, but we
23+
// want other things that do start with m, so we need to progressively handle more characters
24+
// of meta with exclusions.
25+
opts.mangleProps = /^_([^m|_]|m[^e]|me[^t]|met[^a])/;
26+
},
2927
});

0 commit comments

Comments
 (0)