Setting base href using Environment variables

前端 未结 2 974
我在风中等你
我在风中等你 2021-01-05 13:17

Need to set the href value for tag based on build environment configuration.

Eg:

Staging should have

2条回答
  •  无人及你
    2021-01-05 13:51

    This problem was solved. Follow these steps:

    1. In package.json Set homepage key to ""
    2. In .env.staging file Set PUBLIC_URL=/survey
    3. No need to use . Can be removed from HTML file
    4. Change links for stylesheet to

    No need to add process.env

提交回复
热议问题