text: 'use strict';
  
  const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
  const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
  const ignoredFiles = require('react-dev-utils/ignoredFiles');
  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';
  
  module.exports = function(proxy, allowedHost) {
    return {
      disableHostCheck:
        !proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',
      // Enable gzip compression of generated files.
      compress: true,
      // Silence WebpackDevServer's own logs since they're generally not useful.
      // It will still show compile warnings and errors with this setting.
      clientLogLevel: 'none',
      // 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`.
      contentBase: paths.appPublic,
      // By default files from `contentBase` will not trigger a page reload.
      watchContentBase: true,
      // Note that only changes
      // to CSS are currently hot reloaded. JS changes will refresh the browser.
      hot: true,
      // It is important to tell WebpackDevServer to use the same "root" path
      // as we specified in the config. In development, we always serve from /.
      publicPath: config.output.publicPath,
      quiet: true,
      // src/node_modules is not ignored to support absolute imports
      // https://github.com/facebookincubator/create-react-app/issues/1065
      watchOptions: {
        ignored: ignoredFiles(paths.appSrc),
      },
      // Enable HTTPS if the HTTPS environment variable is set to 'true'
      https: protocol === 'https',
      host: host,
      overlay: false,
      historyApiFallback: {
        // Paths with dots should still use the history fallback.
        // See https://github.com/facebookincubator/create-react-app/issues/387.
        disableDotRule: true,
      },
      public: allowedHost,
      proxy,
      before(app) {
        // This lets us open files from the runtime error overlay.
        app.use(errorOverlayMiddleware());
        // This service worker file is effectively a 'no-op' that will reset any
        // previous service worker registered for the same host:port combination.
        // We do this in development to avoid hitting the production cache if
        // it used the same host and port.
        // https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432
        app.use(noopServiceWorkerMiddleware());
      },
    };
  };
  