Skip to content

Commit 7d98d2a

Browse files
committed
fix(config): Disable watching content base and add missing dependency
Added react-overlay dependency and removed the contentBase watching configuration from the dev-server
1 parent f030951 commit 7d98d2a

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

config/webpackDevServer.config.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const errorOverlayMiddleware = require('react-error-overlay/middleware')
22
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware')
33
const config = require('./webpack.config.dev')
4-
const paths = require('./paths')
54

65
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'
76
const host = process.env.HOST || '0.0.0.0'
@@ -31,23 +30,6 @@ module.exports = function (proxy, allowedHost) {
3130
// Silence WebpackDevServer's own logs since they're generally not useful.
3231
// It will still show compile warnings and errors with this setting.
3332
clientLogLevel: 'none',
34-
// By default WebpackDevServer serves physical files from current directory
35-
// in addition to all the virtual build products that it serves from memory.
36-
// This is confusing because those files won’t automatically be available in
37-
// production build folder unless we copy them. However, copying the whole
38-
// project directory is dangerous because we may expose sensitive files.
39-
// Instead, we establish a convention that only files in `public` directory
40-
// get served. Our build script will copy `public` into the `build` folder.
41-
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
42-
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
43-
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
44-
// Note that we only recommend to use `public` folder as an escape hatch
45-
// for files like `favicon.ico`, `manifest.json`, and libraries that are
46-
// for some reason broken when imported through Webpack. If you just want to
47-
// use an image, put it in `src` and `import` it from JavaScript instead.
48-
contentBase: paths.appPublic,
49-
// By default files from `contentBase` will not trigger a page reload.
50-
watchContentBase: true,
5133
// Enable hot reloading server. It will provide /sockjs-node/ endpoint
5234
// for the WebpackDevServer client so it can learn when the files were
5335
// updated. The WebpackDevServer client is included as an entry point

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"postcss-loader": "^2.0.5",
7070
"prompt": "1.0.0",
7171
"react-dev-utils": "^3.0.0",
72+
"react-error-overlay": "^1.0.7",
7273
"style-loader": "^0.18.1",
7374
"url-loader": "0.5.8",
7475
"webpack": "^2.6.1",

yarn.lock

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ alphanum-sort@^1.0.1, alphanum-sort@^1.0.2:
122122
version "1.0.2"
123123
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
124124

125+
anser@1.2.5:
126+
version "1.2.5"
127+
resolved "https://registry.yarnpkg.com/anser/-/anser-1.2.5.tgz#5dcfc956eaa373b9c23010dd20dabec2ce19475b"
128+
125129
anser@1.3.0:
126130
version "1.3.0"
127131
resolved "https://registry.yarnpkg.com/anser/-/anser-1.3.0.tgz#65b42f01119edb5a2fc8ea6f0892274cbcbec6b1"
@@ -790,7 +794,7 @@ babel-register@^6.24.1:
790794
mkdirp "^0.5.1"
791795
source-map-support "^0.4.2"
792796

793-
babel-runtime@^6.18.0, babel-runtime@^6.22.0:
797+
babel-runtime@6.23.0, babel-runtime@^6.18.0, babel-runtime@^6.22.0:
794798
version "6.23.0"
795799
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
796800
dependencies:
@@ -4983,6 +4987,17 @@ react-dev-utils@^3.0.0:
49834987
strip-ansi "3.0.1"
49844988
text-table "0.2.0"
49854989

4990+
react-error-overlay@^1.0.7:
4991+
version "1.0.7"
4992+
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-1.0.7.tgz#8712fe40cfc194ce992a4136c091c03bfada9148"
4993+
dependencies:
4994+
anser "1.2.5"
4995+
babel-code-frame "6.22.0"
4996+
babel-runtime "6.23.0"
4997+
react-dev-utils "^3.0.0"
4998+
settle-promise "1.0.0"
4999+
source-map "0.5.6"
5000+
49865001
read-pkg-up@^1.0.1:
49875002
version "1.0.1"
49885003
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
@@ -5485,6 +5500,10 @@ setprototypeof@1.0.3:
54855500
version "1.0.3"
54865501
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"
54875502

5503+
settle-promise@1.0.0:
5504+
version "1.0.0"
5505+
resolved "https://registry.yarnpkg.com/settle-promise/-/settle-promise-1.0.0.tgz#697adb58b821f387ce2757c06efc9de5f0ee33d8"
5506+
54885507
sha.js@^2.4.0, sha.js@^2.4.8:
54895508
version "2.4.8"
54905509
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f"
@@ -5614,7 +5633,7 @@ source-map-support@^0.4.2:
56145633
dependencies:
56155634
source-map "^0.5.6"
56165635

5617-
source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3:
5636+
source-map@0.5.6, source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3:
56185637
version "0.5.6"
56195638
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
56205639

0 commit comments

Comments
 (0)