File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/react-scripts/config Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ var nodePaths = (process.env.NODE_PATH || '')
4444var envPublicUrl = process . env . PUBLIC_URL ;
4545
4646function getPublicUrl ( appPackageJson ) {
47- return envPublicUrl ? envPublicUrl : require ( appPackageJson ) . homepage ;
47+ return envPublicUrl || require ( appPackageJson ) . homepage ;
4848}
4949
5050// We use `PUBLIC_URL` environment variable or "homepage" field to infer
@@ -54,9 +54,13 @@ function getPublicUrl(appPackageJson) {
5454// We can't use a relative path in HTML because we don't want to load something
5555// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
5656function getServedPath ( appPackageJson ) {
57- var homepagePath = getPublicUrl ( appPackageJson ) ;
58- var homepagePathname = homepagePath ? url . parse ( homepagePath ) . pathname : '/' ;
59- return envPublicUrl ? homepagePath : homepagePathname ;
57+ var publicUrl = getPublicUrl ( appPackageJson )
58+ if ( ! publicUrl ) {
59+ return '/'
60+ } else if ( envPublicUrl ) {
61+ return publicUrl ;
62+ }
63+ return url . parse ( publicUrl ) . pathname ;
6064}
6165
6266// config after eject: we're in ./config/
You can’t perform that action at this time.
0 commit comments