Shader_Minifier
Shader_Minifier copied to clipboard
Feature Request: Modernize JavaScript Output
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.
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?