Skip to content

Commit

Permalink
fix(config): Disable watching content base and add missing dependency
Browse files Browse the repository at this point in the history
Added react-overlay dependency and removed the contentBase watching configuration from the
dev-server
  • Loading branch information
halfzebra committed May 28, 2017
1 parent f030951 commit 7d98d2a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
18 changes: 0 additions & 18 deletions config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const errorOverlayMiddleware = require('react-error-overlay/middleware')
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware')
const config = require('./webpack.config.dev')
const paths = require('./paths')

const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'
const host = process.env.HOST || '0.0.0.0'
Expand Down Expand Up @@ -31,23 +30,6 @@ module.exports = function (proxy, allowedHost) {
// Silence WebpackDevServer's own logs since they're generally not useful.
// It will still show compile warnings and errors with this setting.
clientLogLevel: 'none',
// By default WebpackDevServer serves physical files from current directory
// in addition to all the virtual build products that it serves from memory.
// This is confusing because those files won’t automatically be available in
// production build folder unless we copy them. However, copying the whole
// project directory is dangerous because we may expose sensitive files.
// Instead, we establish a convention that only files in `public` directory
// get served. Our build script will copy `public` into the `build` folder.
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
// <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
// Note that we only recommend to use `public` folder as an escape hatch
// for files like `favicon.ico`, `manifest.json`, and libraries that are
// for some reason broken when imported through Webpack. If you just want to
// use an image, put it in `src` and `import` it from JavaScript instead.
contentBase: paths.appPublic,
// By default files from `contentBase` will not trigger a page reload.
watchContentBase: true,
// Enable hot reloading server. It will provide /sockjs-node/ endpoint
// for the WebpackDevServer client so it can learn when the files were
// updated. The WebpackDevServer client is included as an entry point
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"postcss-loader": "^2.0.5",
"prompt": "1.0.0",
"react-dev-utils": "^3.0.0",
"react-error-overlay": "^1.0.7",
"style-loader": "^0.18.1",
"url-loader": "0.5.8",
"webpack": "^2.6.1",
Expand Down
23 changes: 21 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ alphanum-sort@^1.0.1, alphanum-sort@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"

[email protected]:
version "1.2.5"
resolved "https://registry.yarnpkg.com/anser/-/anser-1.2.5.tgz#5dcfc956eaa373b9c23010dd20dabec2ce19475b"

[email protected]:
version "1.3.0"
resolved "https://registry.yarnpkg.com/anser/-/anser-1.3.0.tgz#65b42f01119edb5a2fc8ea6f0892274cbcbec6b1"
Expand Down Expand Up @@ -790,7 +794,7 @@ babel-register@^6.24.1:
mkdirp "^0.5.1"
source-map-support "^0.4.2"

babel-runtime@^6.18.0, babel-runtime@^6.22.0:
babel-runtime@6.23.0, babel-runtime@^6.18.0, babel-runtime@^6.22.0:
version "6.23.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
dependencies:
Expand Down Expand Up @@ -4983,6 +4987,17 @@ react-dev-utils@^3.0.0:
strip-ansi "3.0.1"
text-table "0.2.0"

react-error-overlay@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-1.0.7.tgz#8712fe40cfc194ce992a4136c091c03bfada9148"
dependencies:
anser "1.2.5"
babel-code-frame "6.22.0"
babel-runtime "6.23.0"
react-dev-utils "^3.0.0"
settle-promise "1.0.0"
source-map "0.5.6"

read-pkg-up@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02"
Expand Down Expand Up @@ -5485,6 +5500,10 @@ [email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/settle-promise/-/settle-promise-1.0.0.tgz#697adb58b821f387ce2757c06efc9de5f0ee33d8"

sha.js@^2.4.0, sha.js@^2.4.8:
version "2.4.8"
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f"
Expand Down Expand Up @@ -5614,7 +5633,7 @@ source-map-support@^0.4.2:
dependencies:
source-map "^0.5.6"

[email protected], 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:
[email protected].6, [email protected].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:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"

Expand Down

0 comments on commit 7d98d2a

Please sign in to comment.