Using create-react-app to create a library

后端 未结 4 1538
野性不改
野性不改 2021-02-20 04:40

I\'m trying to create a library of React-Redux and I\'m trying to use create-react-app to get the boilerplate code but it include in the build script things like appHtml which a

4条回答
  •  春和景丽
    2021-02-20 04:53

    Maybe you could bootstrap youre projects with js-library-boilerplate. I've use it several times and it's good enough to give it a try. It can be used as a base for the vanila js libs or react libs (use CRA under the hood).

    To use it all you need, is to:

    • clone repo
    • make some changes as:


    • Edit LICENSE file

    • Edit package.json information (These will be used to generate the headers for your built files)
    • Edit library: "MyLibrary" with your library's export name in ./config/webpack.config.js
    • Edit ./bin/postinstall (If you would like to display a message on package install)

    ...and you a ready to go. Also all configs are open so you can adjust it as you require. Good luck!

提交回复
热议问题