Skip to content

leonardssh/ragemp-typescript

Repository files navigation

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:

  1. SWC - ⚡ultra fast (no support for const enums)
  2. Typescript - 🐢 very slow (support for const enums)

To use SWC, set COMPILER_USE_SWC to true, and for TYPESCRIPT 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.

  1. Fork / Clone and select the main branch.
  2. Create a new branch in your fork.
  3. Make your changes.
  4. Commit your changes, and push them.
  5. Submit a Pull Request here!

📋 License

This project is licensed under the MIT License - see the LICENSE file for details.