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

Possible to change the mangle name blacklist while using babili preset? #279

Closed
gauntface opened this issue Nov 18, 2016 · 3 comments
Closed

Comments

@gauntface
Copy link

At the moment I'm trying to prevent a class name 'ExampleError' from getting mangled by Babili, I'm doing:

.pipe(babel({
  presets: ['babili', {
    comments: false,
    plugins: [{'minify-mangle-names': {blacklist: {'ExampleError': true}}}],
  }],
}))

I've tried other variants but I'm just not getting anywhere, only receiving the error:

Error: Plugin 0 specified in "foreign" provided an invalid property of "minify-mangle-names"

Any help would be greatly appreciated.

Matt

@boopathi
Copy link
Member

Unfortunately it's not possible now with preset. Preset options are going to land soon - #162.

For now, you can copy the list of plugins from the preset index.js and apply mangle properties to the mangle plugin.

If you use the preset as well as the mangler separately in your plugin list, you ll end up mangling that blacklist anyway because it will be applied twice.

@gauntface
Copy link
Author

Thanks for the info. I'll just give up on what I was trying to do and maybe come back round to this at a later date.

@boopathi
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants