Skip to content

Instantly share code, notes, and snippets.

Created Mar 14, 2019
What would you like to do?
tsconfig.json for npm react component lib
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "src",
"declaration": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
"outDir": "dist",
"sourceMap": true,
"strict": true,
"target": "esnext",
Copy link

petekp commented Mar 14, 2019

To generate types for your components, you'll want to create a new npm script (e.g. build:types) that runs the typescript compiler with these flags: tsc --declaration --emitDeclarationOnly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment