fix(package): specify side-effects and do not bundle output

This commit is contained in:
Linden
2024-09-16 18:34:55 +10:00
parent 7bd22441ff
commit e1c1647343
4 changed files with 618 additions and 505 deletions

View File

@@ -5,6 +5,7 @@
"description": "JS/TS wrapper for ox_lib exports",
"main": "./shared/index.js",
"types": "./shared/index.d.ts",
"sideEffects": ["./shared/resource/locale/index.js"],
"scripts": {
"compile": "tsc",
"prepare": "npm run compile"

1113
package/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
export * from './resource';
// https://www.raygesualdo.com/posts/flattening-object-keys-with-typescript-types/
export type FlattenObjectKeys<T extends Record<string, unknown>, Key = keyof T> = Key extends string
export type FlattenObjectKeys<T extends Record<string, any>, Key = keyof T> = Key extends string
? T[Key] extends Record<string, unknown>
? `${Key}.${FlattenObjectKeys<T[Key]>}`
: `${Key}`

View File

@@ -2,16 +2,15 @@
"compilerOptions": {
"baseUrl": ".",
"strict": true,
"module": "es2020",
"module": "es2022",
"types": ["@types/node", "@citizenfx/client", "@citizenfx/server"],
"declaration": true,
"target": "es2021",
"target": "esnext",
"allowJs": false,
"lib": ["es2021"],
"resolveJsonModule": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "bundler",
"moduleResolution": "node",
"experimentalDecorators": true,
"noImplicitAny": true
},