Open xyzdata opened 6 years ago
`uglifyjs ./libs/modal.js -o ./build/modal.min.js -c -m reserved=['BouncedModal']
`
`uglifyes ./libs/modal.js -o ./build/modal.min.js -c -m reserved=['BouncedModal']
$ npm i -g uglify-es
# uglifyjs ./libs/BouncedModal.js -o ./build/foo.min.js -c -m reserved=['BouncedModal']
# OK
$ uglifyjs -h
$ uglifyjs ./libs/modal.js -o ./build/modal.min.js -c -m reserved=['BouncedModal']
# ??? BAD
$ uglifyes -h
$ uglifyes ./libs/modal.js -o ./build/modal.min.js -c -m reserved=['BouncedModal']
question
/*
// OK ???
uglifyjs -h
# BAD ???
uglifyjs ./libs/sidebar.js -o ./build/sidebar.min.js -c --mangle-props reserved=["STOCK_IP", "STOCK_Paths", "STOCK_SecCode"]
# OK
uglifyjs ./libs/sidebar.js -o ./build/sidebar.min.js -c --mangle-props reserved=["STOCK_IP"]
uglifyjs ./libs/sidebar.js -o ./build/sidebar.min.js -c --mangle-props keep_quoted
properties: {
// mangle property options
reserved: ["STOCK_IP", "STOCK_Paths", "STOCK_SecCode"]
},
*/
// init
STOCK_SecCode = STOCK_F9_FV.Utils.getParam(`gilcode`);
// STOCK_IP = `http://${window.parent.location.host}`;
// STOCK_SecCode = `000001.SZ`;
STOCK_IP = `http://10.1.5.202`;
STOCK_Paths = `/webservice/fastview/stock`;
console.log(`STOCK_SecCode `, STOCK_SecCode, typeof STOCK_SecCode);
http://10.1.5.202/stock/f9/fastview/sidebar.html?gilcode=000001.SZ&market=4609&sid=hs#模块选择
http://10.1.5.202/stock/f9/fastview/sidebar.html?gilcode=600570.SH&market=4609&sid=hs#模块选择
pass .SZ/.SH
webpack uglify bug!
$ npm i -g uglify-es
#OK
uglifyjs -h
uglifyjs ./libs/modal.js -o ./build/modal.min.js -c -m reserved=['BouncedModal']
$ uglifyjs ./libs/modal.js -o ./libs/modal.min.js -c --mangle reserved=['BouncedModal']
$ uglifyjs ./libs/modal.js -o ./libs/modal.min.js -c -m reserved=[`BouncedModal`]
$ uglifyjs ./libs/modal.js -o ./libs/modal.min.js -c -m reserved=["BouncedModal"]
/*
$ npm i -g uglify-es
// OK ???
uglifyjs -h
uglifyjs ./libs/modal.js -o ./build/modal.min.js -c -m reserved=['BouncedModal']
*/
window.OTC_IP = ``;
window.OTC_PATH = ``;
window.OTC_GILCODE = ``;
// forced global variable
// webpack ignore ??? bug
window.onload = () => {
initTabs();
initSidebar();
OTC_IP = `${window.parent.location.origin}`;
OTC_PATH = `/webservice/fastview/otcper`;
OTC_GILCODE = OTC_F9_FV.Utils.getParam(`gilcode`) ? OTC_F9_FV.Utils.getParam(`gilcode`) : `430002.OC`;
// OTC_SOCKET = ``;
console.log(`OTC_GILCODE `, OTC_GILCODE, typeof OTC_GILCODE);
// window.OTC_GILCODE = OTC_GILCODE;
// OTC_GILCODE = OTC_F9_FV.Utils.getParam(`gilcode`);
// OTC_IP = `${window.parent.location.protocol}//${window.parent.location.host}`;
// OTC_IP = `http://${window.parent.location.origin}`;
// OTC_Paths = `/webservice/fastview/otcper`;
};
UglifyJS 3 & CLI
https://github.com/gildata/UglifyJS-3/blob/UglifyJS3/README.md#command-line-usage
https://github.com/gildata/UglifyJS-3/blob/UglifyJS3/README.md#api-reference