Skip to content

how do I add global types #4614

Answered by GiladShoham
GiladShoham asked this question in Help
Discussion options

You must be logged in to vote

In general, you have to create your own custom env.
Then when you overrideTsConfig the second argument is compilerOptions
One of the props of this is types (array of paths to the global types files)
See it here - https://github.com/teambit/bit/blob/master/scopes/react/react/react.main.runtime.ts#L108
you should also overrideBuildTsConfig - https://github.com/teambit/bit/blob/master/scopes/react/react/react.main.runtime.ts#L123
you can see how we use it internally here - https://github.com/teambit/bit/blob/master/scopes/react/react/react.env.ts#L140

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@ivansky
Comment options

@GiladShoham
Comment options

@ivansky
Comment options

@GiladShoham
Comment options

Answer selected by JoshK2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants