|
|
|
|
|
by nilliams
3356 days ago
|
|
Example from the docs [1], Closure compiler can combine 'aggressive renaming', 'dead code removal' and 'function inlining', so it can compile: function unusedFunction(note) {
alert(note['text']);
}
function displayNoteTitle(note) {
alert(note['title']);
}
var flowerNote = {};
flowerNote['title'] = "Flowers";
displayNoteTitle(flowerNote);
to: var a={};a.title="Flowers";alert(a.title);
For comparison, rollup created: function displayNoteTitle(note) {
alert(note['title']);
}
var flowerNote = {};
flowerNote['title'] = "Flowers";
displayNoteTitle(flowerNote);
... (which you'd then have to minify, but as you can see it only eliminated the unused function).[1] https://developers.google.com/closure/compiler/docs/api-tuto... |
|