babel-plugin-minify-mangle-names
Advanced tools
Comparing version 0.3.0-alpha.37064b40 to 0.3.0-alpha.4143a25b
@@ -12,3 +12,3 @@ "use strict"; | ||
} | ||
var fnScope = path.scope.getFunctionParent(); | ||
var fnScope = path.scope.getFunctionParent() || path.scope.getProgramParent(); | ||
var bindingIds = path.getOuterBindingIdentifierPaths(); | ||
@@ -15,0 +15,0 @@ |
@@ -143,3 +143,4 @@ "use strict"; | ||
*/ | ||
if (!isEvalScopesMarked(mangler.program.scope)) { | ||
if (!isEvalScopesMarked(mangler.program)) { | ||
markEvalScopes(mangler.program); | ||
@@ -146,0 +147,0 @@ } |
{ | ||
"name": "babel-plugin-minify-mangle-names", | ||
"version": "0.3.0-alpha.37064b40", | ||
"version": "0.3.0-alpha.4143a25b", | ||
"description": "", | ||
@@ -15,4 +15,4 @@ "keywords": [ | ||
"dependencies": { | ||
"babel-helper-mark-eval-scopes": "^0.3.0-alpha.37064b40" | ||
"babel-helper-mark-eval-scopes": "^0.3.0-alpha.4143a25b" | ||
} | ||
} |
@@ -53,3 +53,5 @@ # babel-plugin-minify-mangle-names | ||
{ | ||
"plugins": ["minify-mangle-names", { "exclude": { "foo": true, "bar": true} }] | ||
"plugins": [ | ||
["minify-mangle-names", { "exclude": { "foo": true, "bar": true} }] | ||
] | ||
} | ||
@@ -74,6 +76,6 @@ ``` | ||
+ `exclude` - A plain JS Object with keys as identifier names and values indicating whether to exclude | ||
+ `eval` - mangle identifiers in scopes accessible by eval | ||
+ `keepFnName` - prevent mangler from altering function names. Useful for code depending on `fn.name` | ||
+ `topLevel` - mangle topLevel Identifiers | ||
+ `keepClassName` - prevent mangler from altering class names. | ||
+ `exclude` - A plain JS Object with keys as identifier names and values indicating whether to exclude (default: `{}`) | ||
+ `eval` - mangle identifiers in scopes accessible by eval (default: `false`) | ||
+ `keepFnName` - prevent mangler from altering function names. Useful for code depending on `fn.name` (default: `false`) | ||
+ `topLevel` - mangle topLevel Identifiers (default: `false`) | ||
+ `keepClassName` - prevent mangler from altering class names (default: `false`). |
40686
80