Skip to content
/ lenix_myscript Public template

A FiveM script template for typescript users

Notifications You must be signed in to change notification settings

LenixStudio/lenix_myscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Boilerplate

Structure

├── shared/      - Shared types, constants, utils
├── client/      - FiveM client (JS runtime)
   └── nui/         - FiveM Browser UI (NUI)
├── server/      - FiveM server (Node runtime)
└── build/       - Compiled output

Setup

pnpm i
pnpm nui
pnpm build

Common Issues

exports2 is not a function

This is causing esbuild to treat it as CommonJS because exports looks like a CommonJS pattern.

  • exports does not exist on the client context by default like the server

Example:

exports('name', name) exports('age', age)

use this on the client context only

Solution:

globalThis.exports('name', name) globalThis.exports('age', age)

About

A FiveM script template for typescript users

Resources

Stars

Watchers

Forks