searched well, but surprisingly enough did not find a proper discussion of this subject in stackoverflow.
I created an NPM package and bundled it using webpack(react and typescript).
when using development settings ({mode:'developmnet',sourceMap: true, declarationMap: true,...}) I got bundle size about 80kb. this bundle includes a source map and declaration map and somewhat readable src code that may help if my lib has some bugs, so as a user you could point a particular line in my lib as the source of error.
when using productions settings bundle size is 20kb (no maps, minified dist code). the code also seems to work much faster. but anyone who consumes my lib can't get any relevant errors regarding my lib during the development of their app.
both builds contain declarations(*.d.ts) files.
now I have an important question: does create-react-app minifies and optimize libs inside node_modules? if this is true I don't care about releasing the unoptimized 80kb bundle, but if that is not true, then I need to think better about how to publish my lib..
what would you suggest? what is the best way to publish a package in such a way to address all the different use-cases?
Update
after building myself production build with create-creat-app with different versions(dev and prod) of my lib - create-react-app minify and optimize even libs in the node_modules folder. so regarding my specific case, I will publish the dev version to npm.
if anyone have better idea can kindly shere.