Skip to content

Commit 30dee4d

Browse files
committed
chore: update build script
1 parent 17e4b3f commit 30dee4d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

make-bridge-loader.ts

+16-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,28 @@ async function nativescriptWebviewBridgeLoader(platform: 'ios' | 'android') {
1010

1111
const values = {
1212
// fetchPolyfill: await fsReadFile('./node_modules/whatwg-fetch/dist/fetch.umd.js', 'UTF-8'),
13-
promisePolyfill: await fsReadFile('./www-src/node_modules/promise-polyfill/dist/polyfill.js', 'UTF-8'),
13+
// promisePolyfill: await fsReadFile('./www-src/node_modules/promise-polyfill/dist/polyfill.js', 'UTF-8'),
1414
webViewBridge: await fsReadFile(`./build/bridge.${platform}.js`, 'UTF-8'),
1515
metadataViewPort: await fsReadFile('./build/metadata-view-port.js', 'UTF-8'),
1616
};
1717

1818
for (const [name, value] of Object.entries(values)) {
1919
const terserRes = await Terser.minify(value, {
20-
compress: true,
21-
mangle: false,
20+
ecma: 2019,
21+
module: false,
22+
toplevel: false,
23+
keep_classnames: false,
24+
keep_fnames: false,
25+
compress: {
26+
passes: 2,
27+
drop_console: true
28+
},
29+
mangle: {
30+
toplevel: true,
31+
properties: {
32+
regex: /^(m[A-Z])/
33+
}
34+
}
2235
});
2336
template = template.replace(`<?= ${name} ?>`, JSON.stringify(terserRes.code));
2437
}

0 commit comments

Comments
 (0)