TypeScript でライブラリ (npm パッケージ) を作るときに, ビルド用の tsconfig を用意することがあります. 例えば以下のような tsconfig.json を作成したとしましょう. { "compilerOptions": { "rootDir": "src", "outDir": "lib", "target": "esnext", "module": "esnext", "moduleResolution": "bundler", "esModuleInterop": true, "strict": true, "sourceMap": true, "declaration": true }, "include": [ "src/**/*" ] } これを使って素朴に tsc -p tsconfig.json のようにビルドすると, src/index.ts