From b2fd6267f3c83c1a4e8a254ee85201a62fc25457 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 19 Oct 2016 14:43:21 +0300 Subject: [PATCH] The need for relative path in the production build User story: I want to publish my app on, for example, Github Pages and I want to leave PUBLIC_URL as a default due to possibility of change of the endpoint url or share the build between several endpoints. --- packages/react-scripts/config/webpack.config.prod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index e0141b851b4..5f2ffeb6613 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -40,7 +40,7 @@ var homepagePath = require(paths.appPackageJson).homepage; var homepagePathname = homepagePath ? url.parse(homepagePath).pathname : '/'; // Webpack uses `publicPath` to determine where the app is being served from. // It requires a trailing slash, or the file assets will get an incorrect path. -var publicPath = ensureSlash(homepagePathname, true); +var publicPath = ensureSlash(homepagePathname, false); // `publicUrl` is just like `publicPath`, but we will provide it to our app // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript. // Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.