Created
December 28, 2012 14:22
-
-
Save arian/4398268 to your computer and use it in GitHub Desktop.
compression and replacing vars/consts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//arian@arian-sys:~/www/wrapup (master) $ ./node_modules/.bin/uglifyjs test.js --compress --mangle --define ES5=false | |
//WARN: Condition always true [test.js:6,34] | |
//WARN: Dropping unreachable code [test.js:9,2] | |
function foo(){console.log("es5")} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(){ | |
const ES5 = true | |
if (typeof ES5 != 'undefined' && ES5) | |
console.log('es5') | |
else | |
console.log('not es5') | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// arian@arian-sys:~/www/wrapup (master) $ ./node_modules/.bin/uglifyjs test.js --compress --mangle --define ES5=false | |
function foo(){var o=!0;o!==void 0&&o?console.log("es5"):console.log("not es5")} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(){ | |
var ES5 = true | |
if (typeof ES5 != 'undefined' && ES5) | |
console.log('es5') | |
else | |
console.log('not es5') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment