I have a shared repo, which I use rollup to package it into an npm module. I’ve noticed that when it is installed and used, there seems to be no type definitions so I’ve been trying to include that but I got stuck
Whenever I run rollup -c
in my shared repo it does not create the type declaration files:
In my shared library, if I run tsc
it does successfully create all my type declaration files, but when I rollup, it doesn’t have it. I don’t understand where I’m going wrong.
Here is my tsconfig.rollup
{
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": false,
"outDir": "./dist",
"declaration": true,
"sourceMap": true,
"noEmit": false
},
"files": ["./rollup.config.ts"]
}
Here is my tsconfig
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": ".",
"paths": {
"src/*": ["src/*"]
},
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"typeRoots": ["./src/types", "./node_modules/@types"],
"noUnusedLocals": false,
"noEmit": false,
"declaration": true,
"outDir": "./dist"
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/Utils/hooks.test.tsx",
"src/WorkflowViewer/workflowViewerTestUtils.tsx"
],
"exclude": ["node_modules", "dist"]
}
1