Using `“homepage”` in package.json, without messing up paths for localhost

后端 未结 4 1241
清酒与你
清酒与你 2020-12-02 14:08

This question actually follows directly from my answer on a previous question.

I added a \"homepage\" to my package.json because it is a Re

4条回答
  •  醉梦人生
    2020-12-02 14:57

    You can override the homepage setting using you dev shell environment:

    $ export PUBLIC_URL=http://localhost:3000/ 
    $ yarn start 
    

    or if you prefer, remove your homepage setting and configure your env before building for production:

    $ export PUBLIC_URL=http://example.com/subdir 
    $ yarn build
    

提交回复
热议问题