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

uglify-js is always downloaded on compatible environments #1488

Closed
Silic0nS0ldier opened this issue Dec 20, 2018 · 4 comments
Closed

uglify-js is always downloaded on compatible environments #1488

Silic0nS0ldier opened this issue Dec 20, 2018 · 4 comments

Comments

@Silic0nS0ldier
Copy link
Contributor

This isn't #1391 but it does have some overlap. The work done towards resolving that issue only permits functionality when uglify-js isn't available.

This issue here is related to how NPM treats optional dependencies. Namely, it treats them as dependencies that the package can work without, but would like to have if possible (e.g. chokidar has an optional dependency on fsevents to permit better file system event handling on unix systems).

To make uglify-js truly optional, it should be a peerDependency. This expresses compatibility without having it automatically installed, leaving the dependency up to whoever uses handlebars.

Happy to make a PR for this (including any updates that would be needed for testing, etc) if people are happy with the proposed change.

@nknapp nknapp added this to the 5.0.0 milestone Apr 5, 2020
@nknapp
Copy link
Collaborator

nknapp commented Apr 5, 2020

I'd like to see this in 5.0, because anyone who uses Handlebars in a pure Node.js-environment, actually does not need uglify at all.

@Silic0nS0ldier
Copy link
Contributor Author

I'll take a look and see if I can get a PR together then.

@nknapp
Copy link
Collaborator

nknapp commented Apr 11, 2020

That's great. Please make sure to use the master-branch as target branch for the merge request.

@Silic0nS0ldier
Copy link
Contributor Author

PR is up. Let me know if there are any questions or concerns.

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

No branches or pull requests

3 participants