getContentBase(webpackConfig) {
        // strip trailing slash (for Unix or Windows)
        const outputPath = webpackConfig.outputPath.replace(/\/$/,'').replace(/\\$/, '');
        // use the manifestKeyPrefix if available
        const publicPath = webpackConfig.manifestKeyPrefix ? webpackConfig.manifestKeyPrefix.replace(/\/$/,'') : webpackConfig.publicPath.replace(/\/$/,'');

        /*
         * We use the intersection of the publicPath (or manifestKeyPrefix) and outputPath
         * to determine the "document root" of the web server. For example:
         *   * outputPath = /var/www/public/build
         *   * publicPath = /build/
         *      => contentBase should be /var/www/public
         *
         * At this point, if the publicPath is non-standard (e.g. it contains
         * a sub-directory or is absolute), then the user will already see
         * an error that they must set the manifestKeyPrefix.
         */

        // start with outputPath, then join publicPath with it, see if it equals outputPath
        // in loop, do dirname on outputPath and repeat
        // eventually, you (may) get to the right path
        let contentBase = outputPath;
        while (path.dirname(contentBase) !== contentBase) {
            if (path.join(contentBase, publicPath) === outputPath) {
                return contentBase;
            }

            // go up one directory
            contentBase = path.dirname(contentBase);
        }

        throw new Error(`Unable to determine contentBase option for webpack's devServer configuration. The ${webpackConfig.manifestKeyPrefix ? 'manifestKeyPrefix' : 'publicPath'} (${webpackConfig.manifestKeyPrefix ? webpackConfig.manifestKeyPrefix : webpackConfig.publicPath}) string does not exist in the outputPath (${webpackConfig.outputPath}), and so the "document root" cannot be determined.`);
    }
Determines the "contentBase" to use for the devServer.

@param {WebpackConfig} webpackConfig
@returns {string}