A minimalist TypeScript boilerplate using SWC for blazing-fast compilation. Generates both cjs and esm modules.
- ⚡ SWC - Super-fast TypeScript/JavaScript compiler
- 📦 Dual package - Outputs both CommonJS and ES Modules
- 🧪 Jest - Testing with SWC for speed
- 🎨 Biome - Fast linting and formatting
- 🔄 Nodemon - Hot reload during development
- 🚀 Semantic Release - Automated versioning and publishing
- 🔒 Husky + lint-staged - Pre-commit hooks
- Node.js >= 24
- pnpm
# Clone the repository
git clone https://github.com/maxgfr/typescript-swc-starter
cd typescript-swc-starter
# Install dependencies
pnpm installpnpm dev # Run in development mode with hot reload
pnpm develop # Run with ts-node (alternative)pnpm test # Run tests
pnpm test:watch # Run tests in watch mode
pnpm test:coverage # Run tests with coveragepnpm lint # Lint code with Biome
pnpm lint:fix # Lint and fix issues
pnpm format # Check formatting
pnpm format:fix # Format code
pnpm check # Run both lint and format checks
pnpm check:fix # Fix both lint and format issuespnpm build # Compile with SWC
pnpm bundle # Bundle for distribution (cjs + esm)
pnpm clean # Clean build artifactspnpm start:cjs # Run CommonJS build
pnpm start:esm # Run ES Module buildThis project uses OIDC for npm publishing - no NPM_TOKEN required!
- Go to your npm package's access page:
https://www.npmjs.com/package/<package-name>/access - Set your details and trust publisher
import { sayHello } from 'typescript-swc-starter';
sayHello();MIT © maxgfr
