1

I am working on a ReactJS project (create-react-app) and in my public folder I have the HTML file which contains

<meta name="viewport" content="width=device-width, initial-scale=1.0">

This one always change to

<meta name="viewport" content="width=device-width,initial-scale=1">

when I build it. But I need to keep initial-scale=1.0 not 1. Do you have any solution for this?

Huy Tran
  • 11
  • 2
  • 1.0 and 1 both means same – angelo Jan 29 '21 at 07:14
  • Hi @angelo, I don't know why. But when I used 1 the meta viewport does not work. Then I used 1.0 that worked. https://stackoverflow.com/questions/58248740/reactjs-viewport-meta-being-ignored – Huy Tran Jan 29 '21 at 07:45

1 Answers1

0

Probably it is issue with html minification. This should be webpack setting in create-react-app.

In order to turn it off you can reject CRA or use https://github.com/timarney/react-app-rewired

Here you can find more details in this reply

2u4u
  • 313
  • 1
  • 7