xxshady / altv-esbuild

Hot reload (without reconnect and restart of the server) ✨
https://xxshady.github.io/altv-esbuild
33 stars 3 forks source link

Get rid of the `altv-enums` module #15

Open xxshady opened 1 year ago

xxshady commented 1 year ago

Improve altvEnums feature by adding ability (it will be a separate option enhancedAltvEnums for backward compatibility) to use enums directly from alt-* modules, as with default typescript compiler (tsc):

- import { RadioStation } from 'altv-enums'
+ import { RadioStation } from 'alt-server'

To allow such code i will add transpilation of enums to js from your own local node_modules/@altv/types-* on initial build of code (types-server, types-client, types-shared)

xxshady commented 1 year ago

One problem which I don't know (or should I?) how to solve is when user updates altv-types regardless of re-running esbuild watch build script, this can cause runtime errors because enums will only be transpiled on initial build