• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

DimiMikadze/create-react-library: React NPM library starter kit based on Faceboo ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

DimiMikadze/create-react-library

开源软件地址(OpenSource Url):

https://github.com/DimiMikadze/create-react-library

开源编程语言(OpenSource Language):

JavaScript 97.1%

开源软件介绍(OpenSource Introduction):

Create React Library npm PRs Welcome

Create React NPM Library with no build configuration, based on Facebook's Create React App. We are constantly updating the repository with the updates of create-react-app, so we have all new features and bug fixes of it.

Quick Overview

npx @udilia/create-react-library my-lib
cd my-lib
npm start

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

Then open http://localhost:3000 to see demo library running in the browser.

Creating a Library

You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine.

To create a new library, you may choose one of the following methods:

npx

npx @udilia/create-react-library my-lib

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

npm

npm init @udilia/react-library my-lib

npm init <initializer> is available in npm 6+

Yarn

yarn create @udilia/react-library my-lib

yarn create is available in Yarn 0.25+

It will create a directory called my-lib inside the current folder. Inside that directory, it will generate the initial project structure and install dependencies.

my-lib
├── config
├── node_modules
├── public
├── scripts
├── src
    ├── demo
    ├── lib
├── .gitignore
├── package.json
├── README.md

All library files are located inside src/lib folder.

Inside src/demo folder, you can test your library while developing.

Once the installation is done, you can open your project folder:

cd my-lib

Inside the newly created project, you can run some built-in commands:

npm start or yarn start

Runs the library in development mode. Open http://localhost:3000 to view it in the browser.

npm run test or yarn run test

Runs the test watcher in an interactive mode.

npm run build or yarn build

Builds the library for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

npm publish

Publishes the library to NPM.

Contributing

Please read our CONTRIBUTING.md before submitting a Pull Request to the project.

Typescript

Adding Typescript support

Troubleshooting

Usage of other libraries within your library

  • Add the library as a peer dependency in package.json (effectively requiring the calling project to provide this dependency)
  • Add the library as a dev dependency in package.json (effectively allowing this library to successfully build without complaining about not having this dependency)
  • Add the library to the externals config in your webpack.config file(s). By default, only react and react-dom are there, meaning that those are the only two libraries that you can use within your new shared library.

Example libraries built with Create React Library

https://github.com/DimiMikadze/react-under-construction

License

MIT License Copyright (c) 2019 Dimi Mikadze




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Gabriella439/Haskell-Pipes-Library: Compositional pipelines发布时间:2022-08-15
下一篇:
Yalantis/uCrop: Image Cropping Library for Android发布时间:2022-08-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap