Created
March 14, 2019 19:35
-
-
Save petekp/170b1fa4837f5f3e77ad077a5cd3c752 to your computer and use it in GitHub Desktop.
tsconfig.json for npm react component lib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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