Introduction
I am seeking guidance on how to correctly set up my tsconfig.json file to ensure only the necessary files are included when running npm run build for my projects. I want to avoid any unnecessary files being imported.
Query
What steps should I take to configure my tsconfig.json effectively for optimal file inclusion while using npm run build?
tsconfig.json Configuration
{
"compilerOptions": {
"target": "ESNext",
"module": "CommonJS",
"declaration": true,
"checkJs": true,
"sourceMap": true,
"outDir": "./dist",
"removeComments": true,
"strict": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src/**/*"],
"compileOnSave": false,
"buildOnSave": false
}
Details in package.json
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Elements seen in node_modules
upon integration into a project
- Would the inclusion of
src
be appropriate? - How can I eliminate
jest.config.js
from the dependencies?