-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Discussion: Best way to create npm packages with create-react-app #907
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
Comments
Hi, thanks for the issue. This tool is current suitable only for apps; you'd have to eject and customize configuration to make it work for a library. Creating something similar for libraries has been discussed before, and I'm still interested to see a proof of concept of this. However so far nobody volunteered to work on it. See #423 (comment). Cheers! |
HI, i've customised |
do you know of anything like this for react-native @DimitriMikadze ? |
@andrespch unfortunately no, i've never tried to create react native library, i don't know what specifics it needs |
Anyone ending up here should check out the create-react-library npm module. It provides a CLI for easily publishing modern React libraries with Rollup and example usage via create-react-app. |
@transitive-bullshit what is the advantage of your library on the 'https://github.com/DimitriMikadze/create-react-library' ? |
The main advantage is that It exposes an actual CLI command It is also significantly simpler, with the resulting library template weighing in at only 14 files. This is largely because we use Rollup, which the community has generally settled on as a better choice for bundling libraries, whereas Dimitri's boilerplate uses webpack. I have tried really hard to keep the boilerplate as minimal as possible. Functionally, I can't think of anything that Dmitri's version does that |
Hi, just to clear some things. My library is ejected @transitive-bullshit i don't think, React community has ever settled down to use Rollup, in fact Rollup never was near as popular as Webpack, even Facebook is using Webpack for it's React development and here's the Google trends comparison: |
@DimitriMikadze where would you configure allowing css modules? Create-react-app allows these by naming as .module.css, is this incorporated in the library? |
@noahzweben |
https://github.com/insin/nwb is a create alternative to solving the problem of using a toolkit for npm packages |
Hi, I suggest u to try: 💯 https://github.com/allan2coder/react-npm-publish this is based on |
Named exports not working with this library |
It's really easy if are you using special tool for publications. Try this library for that https://github.com/markolofsen/how_to_upload_package_to_npm |
Hello!
Love this tool, however, I'm using it to create a component library that I want to publish on NPM and am running into issues accessing the components after I've installed my package.
Process:
Locally, if I get them from the main file, it works fine (as expected)
Main.js
App.js
But, after I install the package and import the components as shown above from
package-name
they are alwaysundefined
.Thoughts into the best practice for this?
The text was updated successfully, but these errors were encountered: