bundle tsup server

This commit is contained in:
Oleksandr Honcharov 2024-06-10 22:39:59 +03:00
parent 2775b42f59
commit c163ef6585
3 changed files with 35 additions and 5 deletions

View File

@ -3,12 +3,11 @@
"version": "0.0.10-alpha.0", "version": "0.0.10-alpha.0",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"type": "module",
"files": [ "files": [
"dist/**/*" "dist/**/*"
], ],
"scripts": { "scripts": {
"build": "node --es-module-specifier-resolution=node build.js && pnpm types", "build": "tsup && pnpm types",
"types": "dts-bundle-generator --config dts.config.json" "types": "dts-bundle-generator --config dts.config.json"
}, },
"dependencies": { "dependencies": {

View File

@ -1,9 +1,29 @@
{ {
"extends": "../tsconfig.json", "$schema": "https://json.schemastore.org/tsconfig",
"display": "Base",
"exclude": [
"node_modules"
],
"compilerOptions": { "compilerOptions": {
"incremental": true,
"composite": false,
"target": "ES2022",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleDetection": "auto",
"module": "CommonJS",
"resolveJsonModule": true,
"declaration": false,
"declarationMap": false,
"sourceMap": false,
"downlevelIteration": false,
"inlineSourceMap": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"typeRoots": [ "typeRoots": [
"@ragempcommunity/types-server" "@ragempcommunity/types-server"
], ]
"baseUrl": "./src"
} }
} }

11
server/tsup.config.ts Normal file
View File

@ -0,0 +1,11 @@
import { defineConfig } from 'tsup'
export default defineConfig({
entry: ['src/index.ts'],
outDir: './dist',
format: ['cjs'],
noExternal: ['rage-rpc'],
splitting: false,
sourcemap: false,
clean: true,
})