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

Message mapping on production build fails #13

Open
mucenica-bogdan opened this issue Mar 20, 2023 · 0 comments
Open

Message mapping on production build fails #13

mucenica-bogdan opened this issue Mar 20, 2023 · 0 comments

Comments

@mucenica-bogdan
Copy link

Hello, there's a bug when build for production and the compiler (vite in my case) has function minification enabled.

In particular here: https://github.com/druc/intus/blob/master/lib/validation.js#L53

`${attributeToWildcard(attribute)}.${this.rules[attribute][rule].name}`

In this.rules[attribute][rule] you have a function, and when you call Function.name you expect to get the function name, which in case of this library means smth. You expect isRequired, isMin, etc.

But with the minification you get whatever the compiler choose for the function: ee, aa, a1.

Not really sure what the solution is for this. I guess you need a definition map for name to function in order to keep this link, as you can't really on the internal js function name.

Bogdan

subscribe @druc

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

1 participant