React Toolchains
阅读原文时间:2023年07月10日阅读:1

React Toolchains

Create React App / component library

https://create-react-app.dev/docs/getting-started/

# cli / offline
$ yarn global add create-react-app 

$ create-react-app app



# commands / online
$ npx create-react-app app

$ yarn create react-app app

$ npm init react-app app

https://reactjs.org/docs/create-a-new-react-app.html

The React team primarily recommends these solutions:

If you’re learning React or creating a new single-page app, use Create React App.

If you’re building a server-rendered website with Node.js, try Next.js.

If you’re building a static content-oriented website, try Gatsby.

If you’re building a component library or integrating with an existing codebase, try More Flexible Toolchains.

A JavaScript build toolchain typically consists of:

A package manager, such as Yarn or npm. It lets you take advantage of a vast ecosystem of third-party packages, and easily install or update them.

A bundler, such as webpack or Parcel. It lets you write modular code and bundle it together into small packages to optimize load time.

A compiler such as Babel. It lets you write modern JavaScript code that still works in older browsers.

If you prefer to set up your own JavaScript toolchain from scratch, check out this guide that re-creates some of the Create React App functionality.

Don’t forget to ensure your custom toolchain is correctly set up for production.

webpack

Parcel



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!