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

Webpack munges model names #24

Open
dupski opened this issue Jun 22, 2018 · 0 comments
Open

Webpack munges model names #24

dupski opened this issue Jun 22, 2018 · 0 comments

Comments

@dupski
Copy link
Contributor

dupski commented Jun 22, 2018

RevJS uses class (function) names to identify models as this makes typings nice to work with (enables DRY + refactoring).

However Webpack (UglifyJS) munges these model names.

There is a workaround which is to enable keep_fnames, but this results in increased bundle size so is not ideal.

We might be able to use keep_classnames. Not tried that. There is also a reserved option for uglify-es that we might be able to pass a list of model names to.

Failing that, we could resort to an additional, non-enumerated __name string property on models, which is a duplicate of the class name. Not pretty and not DRY though!

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