After #2755, functions will be transformed exactly once, and they will be obfuscated iff the obfuscation option is set to true.
This introduces an issue: what if somebody wants to minify their entire JS shader code, but some of it is included in a built and non-minified package?
The proposed solution is to detect such functions, parse their assigned metadata and swap it. This can be achieved by introducing more directives, for example:
- 'use gpu' means a function was not yet parsed by unplugin,
- 'used gpu' means a function was parsed by unplugin but not minified,
- no directive means a function requires no further action (either parsed & minified, or not typegpu at all).
After #2755, functions will be transformed exactly once, and they will be obfuscated iff the
obfuscationoption is set to true.This introduces an issue: what if somebody wants to minify their entire JS shader code, but some of it is included in a built and non-minified package?
The proposed solution is to detect such functions, parse their assigned metadata and swap it. This can be achieved by introducing more directives, for example: