File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,28 @@ async function nativescriptWebviewBridgeLoader(platform: 'ios' | 'android') {
10
10
11
11
const values = {
12
12
// 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'),
14
14
webViewBridge : await fsReadFile ( `./build/bridge.${ platform } .js` , 'UTF-8' ) ,
15
15
metadataViewPort : await fsReadFile ( './build/metadata-view-port.js' , 'UTF-8' ) ,
16
16
} ;
17
17
18
18
for ( const [ name , value ] of Object . entries ( values ) ) {
19
19
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
+ }
22
35
} ) ;
23
36
template = template . replace ( `<?= ${ name } ?>` , JSON . stringify ( terserRes . code ) ) ;
24
37
}
You can’t perform that action at this time.
0 commit comments