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

Posted Jun 27, 20201 min read

Scenes

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

demand

Modify it like this
image.png

practice

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
https://create-react-app.dev/...
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