support import statements (#4646)
This commit is contained in:
@@ -70,6 +70,7 @@ function Compressor(options, false_by_default) {
|
||||
hoist_vars : false,
|
||||
ie8 : false,
|
||||
if_return : !false_by_default,
|
||||
imports : !false_by_default,
|
||||
inline : !false_by_default,
|
||||
join_vars : !false_by_default,
|
||||
keep_fargs : false_by_default,
|
||||
@@ -6081,6 +6082,10 @@ merge(Compressor.prototype, {
|
||||
scope = save_scope;
|
||||
return node;
|
||||
}
|
||||
if (node instanceof AST_SymbolImport) {
|
||||
if (!compressor.option("imports") || node.definition().id in in_use_ids) return node;
|
||||
return in_list ? List.skip : null;
|
||||
}
|
||||
}, function(node, in_list) {
|
||||
if (node instanceof AST_BlockStatement) {
|
||||
return trim_block(node, in_list);
|
||||
|
||||
Reference in New Issue
Block a user