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

Feature Request: Modernize JavaScript Output #239

Open
roblouie opened this issue Feb 26, 2023 · 1 comment
Open

Feature Request: Modernize JavaScript Output #239

roblouie opened this issue Feb 26, 2023 · 1 comment

Comments

@roblouie
Copy link

Love this tool, was super helpful for JS13K Games competition, but I find myself having to modify the output every time I run it due to its usage of very oldschool JS.

I'm requesting that the JS output option be updated to replace all instances of var with export const. Few people are still just including a bunch of js files right in their html, but rather make use of modern JS's module syntax, where each file can be a module that can import and export variables and methods. Also very few people are still using var due to it's scoping issues, and here I think const would be good because we really don't every want to allow these to be reassigned.

Alternatively if there are a lot of users using the old school js pattern, maybe just a new output option of js-module? This would be super helpful for me, and I think a nice feature overall.

@therontarigo
Copy link
Contributor

Best-practices use of scoping and qualifiers that do not change functionality of a correct program seem at odds with goals of minification. Theoretical objections aside, is there a particular incompatibility with modern JS tools or with a minifier for JS itself, which could help illustrate the requirements?

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