-
Notifications
You must be signed in to change notification settings - Fork 40
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
[discussion] Build tools #107
Comments
Inlining of files may change the meaning of programs because the separation between files affects variable scope. From the changelog in the documentation:
|
Good point! Altho, with the local name minification/obfuscation, you should be able to maintain the original file local scoping. |
Would such a system also correctly treat variables declared as global in a file to make it accessible across all the files of the project? In a simpler but related case, how would it treat global variable declarations that occur inside functions but are still global to the file? (I am not sure if they are also global to the project.) |
Yes, the minification shouldn't change/minify globals, only locals, since it can't know if globals might be used in other files etc., so should be no behavior change there regardless of if globals redefined in a function since globals are shared between scopes. Altho, my initial example packing tool doesn't fully handle lazyglobals: |
Working on a build tool similar to "webpack" or "make", written in kerboscript. Just wondering if I should make a PR to this library when it is ready, or if it should be a separate repo.
Also opening a discussion for what build tools / workflow would be useful. Ideally, tools that can be written in kerboscript.
You can take a look at it here in the meantime, lots of abstractions to work out, code to refactor: master...brantwedel:bw/lib-pack-initial
Notable features of lib_pack:
Example lib_pack supporting json library (PR coming, with or without #directives, depending on results of this discussion): https://gist.github.com/brantwedel/218147d6fde9e6da8855646fcacef286
Note: Looking through the history, this discussion is similar to #6 but with a bit more reach than just a stripper (also an "auto doc" plugin would be nice, and maybe sourcemaps for debugging single line minification).
The text was updated successfully, but these errors were encountered: