ragemp-typescript
ragemp-typescript copied to clipboard
A Typescript Boilerplate for RAGE:MP with simple setup and usage.
A Typescript Boilerplate for RAGE:MP with simple setup and usage.
Remember to π this Github if you π it.
For Javascript Edition, see: ragemp-javascript
π Features
- Full RAGE:MP Type Support for VSCode
- Built in rollup config for transpile and auto-copy (incredibly fast using the SWC)
- Prettier Configuration for code formatting.
π₯ Installation
Prerequisites
Clone the Repository
Use the command below in any terminal, command prompt, etc.
git clone https://github.com/leonardssh/ragemp-typescript.git
Install the necessary modules
Use the command below in any terminal, command prompt, etc.
cd ragemp-typescript
npm install
Rename the .env.example
file to .env
Without it, rollup will not be able to copy the files properly
Compiler Configuration
The boilerplate comes with 2 compilers:
- SWC - β‘ultra fast (no support for const enums)
- Typescript - π’ very slow (support for const enums)
To use SWC, set
COMPILER_USE_SWC
to true, and forTYPESCRIPT
to false
PRODUCTION_MODE=false
COMPILER_USE_SWC=true // <--- CHANGE THE COMPILER BETWEEN SWC & TYPESCRIPT
Build the server
Use the command below in any terminal, command prompt, etc. This will transpile and copy the files to the dist
folder. Folder which is used for production.
npm run build
Get Server Files
Grab the server files from RAGEMP/server-files
and drop them in the dist
folder.
Start the Server
cd ./dist
./ragemp-server.exe
π¨βπ» Contributing
To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.
- Fork / Clone and select the
main
branch. - Create a new branch in your fork.
- Make your changes.
- Commit your changes, and push them.
- Submit a Pull Request here!
π License
This project is licensed under the MIT License - see the LICENSE file for details.