The bytecode module transforms your clientside code to V8 bytecode on the serverside before the files are sent to the client. Thus, it makes stealing the original source files by dumping them clientside completely impossible.
It is recommended to only use the bytecode module in production. This is because the source files are missing for the client, so it is not possible to generate a stack trace or any other additional debug information, making debugging errors and other issues a lot harder.
Setting up the bytecode module
Setting up the bytecode module is a relatively easy process, just follow the steps below:
- Download the bytecode module, and place the downloaded
modulesarray in the
- For every resource you want to use the bytecode module for set the
- Start the server
Now every time you start the server you should get logs similiar to this one:
Converted file to bytecode: path/file.js
There is still an optional step left, but this step is only needed when the code is using dynamic import to import any files,
that are not otherwise imported. As the module compiles all imported files recursively, by starting from the main file and compiling
all its dependencies (modules imported with the
import statement), it is not possible for the module to know the files that are dynamically imported.
So these have to be manually specified, so they are also compiled.
To do this just:
- Add all files that should additionally be compiled to the
extra-compile-filesarray in the
That array accepts the same paths as the
client-files option does, so it is possible to include a whole folder for example.
The module can be downloaded from the following sources:
- The official alt:V downloads page
- The CDN directly - Windows / Linux
- The bytecode module releases page
Help! I have an error saying...
First of all, make sure your code runs without any errors. If the code has any errors in the top level code (like syntax errors), the module will fail to compile.
If the code runs fine without the bytecode module but the module still reports an error, contact us on Discord.