All Guides
TypeScript Einrichtung und Konfiguration
Fuegen Sie TypeScript zu Ihrem Projekt hinzu und konfigurieren Sie tsconfig.json.
Beginner10 Min.
Setup Steps
1. Install TypeScript:
npm install -D typescript2. Create tsconfig.json:
npx tsc --init3. Recommended tsconfig.json settings:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"sourceMap": true,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}4. Compile:
npx tsc5. Watch mode compilation:
npx tsc --watch6. Run TypeScript with Node.js:
npm install -D tsx
npx tsx src/index.ts7. Type definition files:
npm install -D @types/node @types/express8. package.json scripts:
"scripts": {
"build": "tsc",
"dev": "tsx watch src/index.ts",
"start": "node dist/index.js"
}Related Guides
Auf Vercel deployen
Deployen Sie Ihr Next.js oder React-Projekt auf Vercel.
Auf Netlify deployen
Deployen Sie Ihre statische Website auf Netlify.
Bun Runtime Einrichtung
Installieren Sie die Bun JavaScript/TypeScript-Laufzeitumgebung.
Deno Einrichtung
Installieren Sie die Deno JavaScript/TypeScript-Laufzeitumgebung.