typescript-devdependencies
Installation
SKILL.md
Put TypeScript and @types in devDependencies
Overview
TypeScript is a development tool - it doesn't exist at runtime. Similarly, @types packages contain only type declarations, not runtime code. Both should be installed as devDependencies, not dependencies. This keeps production builds lean and prevents version conflicts.
Understanding the distinction between dependencies and devDependencies is crucial for library authors and application developers alike.
When to Use This Skill
- Setting up a new TypeScript project
- Installing @types packages
- Configuring package.json dependencies
- Publishing TypeScript libraries
- Managing project dependencies
The Iron Rule
TypeScript and @types packages belong in devDependencies. They are development-only tools and don't exist at runtime.