react

react—脚手架

vue中有vue-cli,同样react中也有react的cli:create-react-app

安装

npm install -g create-react-app

创建项目

create-react-app <项目名>

创建成功,我这里是用yarn来管理的

启动项目

yarn start  npm对应 npm run start

打包项目

yarn build  npm对应 npm run build

测试

yarn test  npm对应 npm run test

暴露webpack等配置文件

yarn eject  npm对应 npm run eject

此操作是不可逆的!!!一般不会使用,要想配置webpack配置可使用craco

脚手架创建的项目

517条评论

  • Cloud Slippers

    Just desire to say your article is as amazing. The clearness
    in your post is simply spectacular and i could assume you are an expert on this subject.

    Fine with your permission let me to grab your feed to keep
    updated with forthcoming post. Thanks a million and please carry on the gratifying
    work.

  • Bath Sheets

    Hey! This is kind of off topic but I need some guidance from an established blog.
    Is it difficult to set up your own blog? I’m
    not very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure where
    to start. Do you have any ideas or suggestions? Thank you

Leave a Reply

邮箱地址不会被公开。