Skip to content

Instantly share code, notes, and snippets.

@saiumesh535
Last active June 28, 2025 09:48
Show Gist options
  • Save saiumesh535/94a3d8e4af06aa57578a13bc46bc5db5 to your computer and use it in GitHub Desktop.
Save saiumesh535/94a3d8e4af06aa57578a13bc46bc5db5 to your computer and use it in GitHub Desktop.
Base TS Project

package.json

"scripts": {
    "clean": "rm -rf dist",
    "dev:watch": "npm run clean && tsup --watch src/index.ts --onSuccess 'node dist/index.js'",
    "build": "npm run clean && tsup"
  }

tsconfig.json

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "CommonJS",
    "lib": ["ES2020"],
    "outDir": "dist",
    "rootDir": "src",
    "strict": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "noImplicitAny": true
  },
  "include": ["src"],
  "exclude": ["node_modules", "dist"]
} 

tsup (tsup.config.ts)

import { defineConfig } from 'tsup'

export default defineConfig({
  entry: ['src/index.ts'],
  splitting: false,
  sourcemap: true,
  clean: true,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment