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

--reserved option no effect to property names #946

Closed
ghost opened this issue Jan 28, 2016 · 6 comments
Closed

--reserved option no effect to property names #946

ghost opened this issue Jan 28, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Jan 28, 2016

I want to prevent mangle some properties, but -r option seems work only for variable names.
I don't want to use --reserved-file option. Is there any solution for that?

@ghost ghost changed the title --reserved options no effect to property names --reserved option no effect to property names Jan 28, 2016
@rvanvelzen
Copy link
Collaborator

Use --mangle-props --mangle-regex '/^(name1|name2)/'.

@ghost
Copy link
Author

ghost commented Jan 28, 2016

@rvanvelzen why do you close this issue. Your code just for mangle name1 and name2 properties. I want to mangle all of properties exclude some names. With big js file, your code is not helpful.

@avdg
Copy link
Contributor

avdg commented Jan 28, 2016

@ptcong Do you have a use case matching close to your expectations?

@rvanvelzen
Copy link
Collaborator

I want to mangle all of properties exclude some names

--mangle-regex '/^(?!(exluded1|excluded2)$)/'

But seriously, tell us what your use case is. I've given you examples that answer your specific question.

@ghost
Copy link
Author

ghost commented Jan 28, 2016

Sorry, i just tried again with this command
--mangle-regex '/^(?!(name1|name2)$)/',
and it works. Previous i used like this, and it seems not works properly.
--mangle-regex='/^(?!(name1|name2)$)/'

@rvanvelzen
Copy link
Collaborator

Hmm. That might an issue with yargs. Though, I'm sure that should work.

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