create-react-app build MPA custom head <meta>

Posted Jun 27, 20201 min read


Recently bloggers are learning H5 using react, you need to modify the tag to disable the zoom function


Modify it like this


npm install -g create-react-app # install cra
npm install -g yarn # for package management
mkdir mobile # Create folder
create-react-app my-mobile --typescript # ts version, if you need js, delete --typescript

At this time, there is index.html in the pubic folder on the directory structure, you can modify it here

Additional requirements

Bloggers also use sass in this project, and cra also provides related support
Note that the cra official website gives a hint that sass only supports react-scripts@2.0.0 or higher. If you want to add sass to an old project, you need to pay attention to the version.

yarn add node-sass # ok