Skip to content

feat(unplugin-typegpu): Obfuscate functions that were already transformed #2783

Description

@aleksanderkatan

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions