Advanced Installation
Module System Support
Package Exports Structure
dist/
├── index.js # CommonJS main entry
├── index.mjs # ES Modules main entry
├── index.d.ts # TypeScript definitions
├── streaming.js # CommonJS streaming module
├── streaming.mjs # ES Modules streaming module
├── streaming.d.ts # Streaming TypeScript definitions
├── performance.js # CommonJS performance module
├── performance.mjs # ES Modules performance module
├── performance.d.ts # Performance TypeScript definitions
├── errors.js # CommonJS error handling
├── errors.mjs # ES Modules error handling
└── errors.d.ts # Error handling TypeScript definitionsEnvironment-Specific Setup
Node.js Projects
ESM Projects (package.json with "type": "module")
CommonJS Projects
Mixed Projects (CommonJS with ESM imports)
TypeScript Projects
tsconfig.json Configuration
Type Imports
Frontend Frameworks
React/Next.js
Vue.js
Server Environments
Express.js
Serverless Functions
Bundle Size Optimization
Automatic Module Selection
Tree Shaking (Webpack/Vite)
Lazy Loading
Bundle Analysis
Last updated