React – replance %PUBLIC_URL% in production build

Veröffentlicht von

Change the URL of React applications at „npm run buld“.

When publishing React applications, the compiler or application assumes that it is running in the root directory of the web server. If it is in a subdirectory, the application will stop working because the script and CSS files cannot be found.

The solution is the setting for „homepage“ in the „package.json“ file.

"homepage": "http://localhost/vodtest",

After that, the application will also work in a subfolder.

Kommentar hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht.