Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the use of dist, es, lib folder #2086

Closed
Rajesh-Thiyagarajan opened this issue Jan 25, 2021 · 5 comments
Closed

What is the use of dist, es, lib folder #2086

Rajesh-Thiyagarajan opened this issue Jan 25, 2021 · 5 comments

Comments

@Rajesh-Thiyagarajan
Copy link

Hi team

To understand how reactstrap working i am asking this question.
image

What is use of es, dist, lib folder ?
why we are providing src code to the user ?

@TheSharpieOne
Copy link
Member

Different users use different loaders.
dist is for CDNs, it powers things like https://cdnjs.com/libraries/reactstrap. Everything gets transpiled and there is UMD exporting. There are also a couple of "flavor" with and without external dependencies.
lib is for commonjs importing (using require and exports), plus everything gets transpiled.
es is for module importing (using import and export), it's good for treeshaking, plus everything else gets transpiled.
src is also for module importing, but it allows for the end user to determine what gets transpiled and can be useful for avoiding the extra junk in es. I believe this is what CRA will pick up out-of-the-box now-a-days. Webpack with babel-loader will do the same unless you tell it to exclude node_modules.

@Rajesh-Thiyagarajan
Copy link
Author

Is reactstarp will not support TypeScript ?

@TheSharpieOne
Copy link
Member

TheSharpieOne commented Feb 2, 2021

typings are included in es and lib. There used to be @types/reactstrap, but that was moved to be within the repo. I guess we are not including the types in the release for the src. @kyletsang should we be including the types directory in the release artifacts?

@Rajesh-Thiyagarajan
Copy link
Author

@TheSharpieOne I am just asking for my knowledge. what is the project name ? like Node.js prospect, React project , etc ...
image

@TheSharpieOne
Copy link
Member

this project is named "reactstrap"; as found in the "name" property within the package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants