create-react-app npm run build command

前端 未结 9 768
春和景丽
春和景丽 2020-12-15 18:03

I have a built a small React application with create-react-app, and it runs fine from the local server after running npm start. OK so far.

9条回答
  •  情话喂你
    2020-12-15 18:14

    open index.html file. scroll near end and you will see

    
    

    just add a dot in front of the two src attribute:

    
    

    also if you have any styles you must also scroll near beginning where you will see:

    
    

    and also place a dot in front of the href attribute

    
    

    NOTE: filename may/will not be the same for you

    also be sure to change this back when using a server or just run npm run build again(i have no idea what happens if you dont)

提交回复
热议问题