#How to properly construct a component library?

3 messages · Page 1 of 1 (latest)

empty garden
#

What is the proper way to handle a local react component library that is used in internal react projects.
Should you transpile the library before it is imported into your application or would you just have an index.ts entrypoint and allow the consuming application to handle the transpiling?

broken ether
#

@empty garden You should transpile to JS and publish the JS (and generated .d.ts files).

#

It's both more efficient - (only transpile once on build, not on every single consumer) and avoids a lot of potential type errors due to TS version mismatches.