https://github.com/leonardssh/ragemp-typescript
A Typescript Boilerplate for RAGE:MP with simple setup and usage.
https://github.com/leonardssh/ragemp-typescript
nodejs ragemp typescript
Last synced: about 1 year ago
JSON representation
A Typescript Boilerplate for RAGE:MP with simple setup and usage.
- Host: GitHub
- URL: https://github.com/leonardssh/ragemp-typescript
- Owner: leonardssh
- License: mit
- Created: 2021-11-26T13:41:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-21T11:42:06.000Z (about 2 years ago)
- Last Synced: 2025-03-18T01:43:03.699Z (about 1 year ago)
- Topics: nodejs, ragemp, typescript
- Language: JavaScript
- Homepage: https://rage.mp
- Size: 86.9 KB
- Stars: 44
- Watchers: 2
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A Typescript Boilerplate for RAGE:MP with simple setup and usage.
Remember to π this Github if you π it.
> For Javascript Edition, see: [ragemp-javascript](https://github.com/leonardssh/ragemp-javascript)
## π Features
- Full RAGE:MP Type Support for VSCode
- Built in rollup config for transpile and auto-copy (incredibly fast using the [SWC](https://github.com/swc-project/swc))
- Prettier Configuration for code formatting.
## π₯ Installation
### Prerequisites
- [Install NodeJS 16+](https://nodejs.org/en/download/current/)
- [Install GIT](https://git-scm.com/downloads)
### Clone the Repository
Use the command below in any terminal, command prompt, etc.
```sh
git clone https://github.com/leonardssh/ragemp-typescript.git
```
### Install the necessary modules
Use the command below in any terminal, command prompt, etc.
```sh
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](https://swc.rs/) - β‘ultra fast (no support for const enums)
2. [Typescript](https://www.npmjs.com/package/rollup-plugin-typescript2) - π’ very slow (support for const enums)
> To use SWC, set `COMPILER_USE_SWC` to true, and for `TYPESCRIPT` to false
```bash
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.
```sh
npm run build
```

### Get Server Files
Grab the server files from `RAGEMP/server-files` and drop them in the `dist` folder.
### Start the Server
```sh
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](https://github.com/LeonardSSH/ragemp-typescript/pulls)!
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.