Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for mangle and dce options #111

Merged
merged 1 commit into from
Aug 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ require("babel-core").transform("code", {
plugins: ["minify-dead-code-elimination"]
});
```

## Options

+ `keepFnames` - prevent plugin from removing function names. Useful for code depending on `fn.name`
Copy link
Member

@hzoo hzoo Aug 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe function.name? Maybe i'm ok with the option being keepFunctionnames

8 changes: 7 additions & 1 deletion packages/babel-plugin-minify-mangle-names/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ $ npm install babel-plugin-minify-mangle-names

// with options
{
"plugins": ["minify-mangle-names", { "mangleBlacklist": { "foo": true, "bar": true} }]
"plugins": ["minify-mangle-names", { "blacklist": { "foo": true, "bar": true} }]
}
```

Expand All @@ -65,3 +65,9 @@ require("babel-core").transform("code", {
plugins: ["minify-mangle-names"]
});
```

## Options

+ `blacklist` - A plain JS Object with keys as identifier names and values indicating whether to exclude
+ `eval` - mangle identifiers in scopes accessible by eval
+ `keepFnames` - prevent mangler from alterning function names. Useful for code depending on `fn.name`