-
-
Save MaxMotovilov/de9090d3197d2ff75df9b25c9086e6d4 to your computer and use it in GitHub Desktop.
Running Uglify twice results in correct optimization!
This file contains 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
export default function() { console.log( "A" ) } |
This file contains 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
export { b } | |
function b() { console.log( "B" ) } |
This file contains 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() { | |
"use strict"; | |
function o() { | |
console.log("B") | |
} | |
for (var n = 0, c = 1, t = function() { | |
console.log("A") | |
}, f = 0; f < 2; ++f) n && t(), c && o() | |
}(); |
This file contains 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() { | |
"use strict"; | |
for (var o = 0; o < 2; ++o) console.log("B") | |
}(); |
This file contains 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
export const A=0, B=1; |
This file contains 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
import * as conf from "./configuration"; | |
import a from "./a"; | |
import * as b from "./b" ; | |
function foo() { | |
if( conf.A ) | |
a(); | |
if( conf.B ) | |
b.b(); | |
} | |
for( var i=0; i<2; ++i ) | |
foo(); |
This file contains 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
import uglify from 'rollup-plugin-uglify'; | |
import buble from 'rollup-plugin-buble'; | |
export default { | |
entry: 'main.js', | |
format: 'iife', | |
exports: "none", | |
interop: false, | |
plugins: [ buble(), uglify() /* , uglify() -- uncomment for right result */ ], | |
dest: 'bundle.once.js' /* change to bundle.twice.js when uncommenting 2nd uglify instance */ | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment