Bundling

Fry offers an integrated bundling tool for FatScript code.

Usage

To bundle your project into a single file starting from the entry point, execute:

fry -b sweet mySweetProject.fat

This process consolidates all imports, except for standard libraries and literal paths, and removes spaces and comments to enhance load times:

  • Adds a shebang to bundled code
  • Receives the execute attribute for file mode

Subsequently, you can run your program:

./sweet

the bundling will replace any $break statements (debugger breakpoint) with ()

Obfuscating

For optional obfuscation, use -o:

fry -o sweet mySweetProject.fat  # creates the obfuscated bundle
./sweet                          # executes your program as usual

When distributing via public hosts, consider setting a custom key with a local .fryrc. Only the client should be privy to this key to safeguard the source.

Obfuscation leverages enigma algorithm for encryption, ensuring swift decoding. For optimal load times, prefer -b if obfuscation isn't essential.

Caveats

Imports are deduplicated and inlined based on their order of first appearance. As a result, the sequence in which you import your files could play a role in the final bundled output. Though these considerations are usually inconsequential for small projects, bundling larger projects may require additional organization. Always validate your bundled output.

results matching ""

    No results matching ""