Giter Site home page Giter Site logo

mojito-fivem / fivem-typescript-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from project-error/fivem-typescript-boilerplate

1.0 0.0 0.0 47 KB

A simple boilerplate for getting started with TypeScript in FiveM

License: MIT License

TypeScript 32.98% Lua 7.70% JavaScript 59.32%

fivem-typescript-boilerplate's Introduction

Material-UI logo

FiveM TypeScript Resource Boilerplate

This is a simple boilerplate for getting started with TypeScript game-scripts, in FiveM.

license Discord

This repository is a basic boilerplate for getting started with TypeScript resources in FiveM. This boilerplate only comes with development dependencies needed for FiveM-centered TypeScript transpilation, the rest is up to you.

Note: This boilerplate is targeting TypeScript in context of game-scripts, if you wish to use TypeScript in NUI, take a look at our other boilerplate

Foreword

Although there already is a well established TypeScript boilerplate, made by d0p3t for the FiveM ecosystem, he has unfortunately passed away, leaving it unmaintained. This boilerplate is simply a more up to date alternative.

Requirements

  • Node > v14

Getting Started

First clone the repository or use the template option and place it within your resources folder

Install Dependencies

Navigate into the newly cloned folder and execute the following command, to install dependencies.

npm i

Development

Hot Building

While developing your resource, this boilerplate offers a watchscript that will automatically hot rebuild on any change within the client or server directories.

npm run watch

This script still requires you restart the resource for the changes to be reflected in-game

Entry Points

Client - ./client/client.ts

Server - ./server/server.ts

Production Build

Once you have completed the development phase of your resource, you must create an optimized & minimized production build, using the build script.

npm run build

Automatic Builds (Optional)

This is not recommended as the embedded version of yarn is ocassionally prone to performance and environment problems. We highly recomend, you manually run the build script

If desired, the fxmanifest.lua can be setup to allow for FXServer to automatically build on resource start. This utilizes the embedded yarn & webpack default resources.

To enable this, add the following to your fxmanifest.lua

dependency {
    'yarn',
    'webpack'
}

webpack_config 'webpack.config.js'

Additional Notes

Need further support? Join our Discord!

fivem-typescript-boilerplate's People

Contributors

tasooneasia avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.