This piece explains Egret uses the Jszip to parse the pressurized JS code, then restores it to the executable JS code.
First, pack the Egret library:
①: Build a Egret folder in the root directory of the Web site where you put the class library
650) this.width=650; "title=" 03.png "src=" https://s2.51cto.com/wyfs02/M00/07/F6/wKiom1nXN_ Hwyq8taadkokxcwbw778.png-wh_500x0-wm_3-wmp_4-s_3684051099.png "alt=" wkiom1nxn_hwyq8taadkokxcwbw778.png-wh_50 "/ >
②: Package The Egret folder as a egret.zip
Two, package the main.min.js into a main.min.js.zip
Three, index.html
<! doctype html>Website structure:
650) this.width=650; "title=" 04.png "src=" https://s2.51cto.com/wyfs02/M01/A6/A8/ Wkiol1nxp8ybutewaadwtxdautm482.png-wh_500x0-wm_3-wmp_4-s_2017195991.png "alt=" Wkiol1nxp8ybutewaadwtxdautm482.png-wh_50 "/>
To view loading results using a browser:
650) this.width=650; "title=" 02.png "src=" https://s4.51cto.com/wyfs02/M02/07/F6/ Wkiom1nxqeurzao4aaa8tck2uv0103.png-wh_500x0-wm_3-wmp_4-s_3380962785.png "alt=" Wkiom1nxqeurzao4aaa8tck2uv0103.png-wh_50 "/>
If you do not use compression, the result is:
650) this.width=650; "title=" 01.png "src=" https://s5.51cto.com/wyfs02/M00/07/F6/wKiom1nXQIChcyN2AACf_ Zqqe9g426.png-wh_500x0-wm_3-wmp_4-s_3796504730.png "alt=" Wkiom1nxqichcyn2aacf_zqqe9g426.png-wh_50 "/>
You can see that the cost of loading is much higher than uncompressed. Especially when the project is large. This is the meaning of compression js .....
This article is from the "Better_power_wisdom" blog, make sure to keep this source http://aonaufly.blog.51cto.com/3554853/1970528
Egret's Jszip Advanced application: Compression JS