Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Commit 4a30847

Browse files
author
Andrew Luca
committed
feat: keep public files from root
1 parent c7cd1ae commit 4a30847

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/react-dev-utils/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Returns Express middleware that serves a `${servedPath}/service-worker.js` that
294294
#### `redirectServedPathMiddleware(servedPath: string): ExpressMiddleware`
295295

296296
Returns Express middleware that redirects to `${servedPath}/${req.path}`, if `req.url`
297-
does not start with servedPath``. Useful for development.
297+
does not start with `servedPath`. Useful for development.
298298

299299
#### `openBrowser(url: string): boolean`
300300

packages/react-scripts/config/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module.exports = function(webpackEnv) {
8080
const publicUrl =
8181
shouldUseRelativeAssetPaths && isEnvDevelopment
8282
? ''
83-
: publicPath.slice(0, -1);
83+
: paths.servedPath.slice(0, -1);
8484

8585
// Get environment variables to inject into our app.
8686
const env = getClientEnvironment(publicUrl);

packages/react-scripts/config/webpackDevServer.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ module.exports = function(proxy, allowedHost) {
6363
// for some reason broken when imported through Webpack. If you just want to
6464
// use an image, put it in `src` and `import` it from JavaScript instead.
6565
contentBase: paths.appPublic,
66+
contentBasePublicPath: '/test',
6667
// By default files from `contentBase` will not trigger a page reload.
6768
watchContentBase: true,
6869
// Enable hot reloading server. It will provide /sockjs-node/ endpoint
@@ -77,7 +78,7 @@ module.exports = function(proxy, allowedHost) {
7778
publicPath: shouldUseRelativeAssetPaths ? '/' : paths.servedPath,
7879
// WebpackDevServer is noisy by default so we emit custom message instead
7980
// by listening to the compiler events with `compiler.hooks[...].tap` calls above.
80-
quiet: true,
81+
quiet: false,
8182
// Reportedly, this avoids CPU overload on some systems.
8283
// https://github.com/facebook/create-react-app/issues/293
8384
// src/node_modules is not ignored to support absolute imports
@@ -93,7 +94,9 @@ module.exports = function(proxy, allowedHost) {
9394
// Paths with dots should still use the history fallback.
9495
// See https://github.com/facebook/create-react-app/issues/387.
9596
disableDotRule: true,
96-
index: shouldUseRelativeAssetPaths ? '/' : paths.servedPath,
97+
index: (shouldUseRelativeAssetPaths ? '/' : paths.servedPath).concat(
98+
'index.html'
99+
),
97100
},
98101
public: allowedHost,
99102
proxy,

packages/react-scripts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "react-scripts",
33
"version": "3.0.1",
44
"description": "Configuration and scripts for Create React App.",
5+
"homepage": "/test",
56
"repository": {
67
"type": "git",
78
"url": "https://github.com/facebook/create-react-app.git",

0 commit comments

Comments
 (0)