async applyProxyTable(app) {
        // avoid skipping project root
        const fileInRoot = ($parcel$interopDefault($68DQ8$path)).join(this.options.projectRoot, '_');
        const pkg = await $68DQ8$parcelutils.loadConfig(this.options.inputFS, fileInRoot, [
            '.proxyrc.js',
            '.proxyrc',
            '.proxyrc.json'
        ], this.options.projectRoot);
        if (!pkg || !pkg.config || !pkg.files) return this;
        const cfg = pkg.config;
        const filename = ($parcel$interopDefault($68DQ8$path)).basename(pkg.files[0].filePath);
        if (filename === '.proxyrc.js') {
            if (typeof cfg !== 'function') {
                this.options.logger.warn({
                    message: "Proxy configuration file '.proxyrc.js' should export a function. Skipping..."
                });
                return this;
            }
            cfg(app);
        } else if (filename === '.proxyrc' || filename === '.proxyrc.json') {
            if (typeof cfg !== 'object') {
                this.options.logger.warn({
                    message: "Proxy table in '.proxyrc' should be of object type. Skipping..."
                });
                return this;
            }
            for (const [context, options] of Object.entries(cfg))// each key is interpreted as context, and value as middleware options
            app.use($d5ec61ae293989fa$exports.createProxyMiddleware(context, options));
        }
        return this;
    }
/**
   * Load proxy table from package.json and apply them.
   */
Load proxy table from package.json and apply them.
Load proxy table from package . json and apply them .
async applyProxyTable(app) {
        const fileInRoot = ($parcel$interopDefault($68DQ8$path)).join(this.options.projectRoot, '_');
        const pkg = await $68DQ8$parcelutils.loadConfig(this.options.inputFS, fileInRoot, [
            '.proxyrc.js',
            '.proxyrc',
            '.proxyrc.json'
        ], this.options.projectRoot);
        if (!pkg || !pkg.config || !pkg.files) return this;
        const cfg = pkg.config;
        const filename = ($parcel$interopDefault($68DQ8$path)).basename(pkg.files[0].filePath);
        if (filename === '.proxyrc.js') {
            if (typeof cfg !== 'function') {
                this.options.logger.warn({
                    message: "Proxy configuration file '.proxyrc.js' should export a function. Skipping..."
                });
                return this;
            }
            cfg(app);
        } else if (filename === '.proxyrc' || filename === '.proxyrc.json') {
            if (typeof cfg !== 'object') {
                this.options.logger.warn({
                    message: "Proxy table in '.proxyrc' should be of object type. Skipping..."
                });
                return this;
            }
            for (const [context, options] of Object.entries(cfg))
            app.use($d5ec61ae293989fa$exports.createProxyMiddleware(context, options));
        }
        return this;
    }
async applyProxyTable ( app ) { const fileInRoot = ( $parcel$interopDefault ( $68DQ8$path ) ) . join ( this . options . projectRoot , '_' ) ; const pkg = await $68DQ8$parcelutils . loadConfig ( this . options . inputFS , fileInRoot , [ '.proxyrc.js' , '.proxyrc' , '.proxyrc.json' ] , this . options . projectRoot ) ; if ( ! pkg || ! pkg . config || ! pkg . files ) return this ; const cfg = pkg . config ; const filename = ( $parcel$interopDefault ( $68DQ8$path ) ) . basename ( pkg . files [ 0 ] . filePath ) ; if ( filename === '.proxyrc.js' ) { if ( typeof cfg !== 'function' ) { this . options . logger . warn ( { message : "Proxy configuration file '.proxyrc.js' should export a function. Skipping..." } ) ; return this ; } cfg ( app ) ; } else if ( filename === '.proxyrc' || filename === '.proxyrc.json' ) { if ( typeof cfg !== 'object' ) { this . options . logger . warn ( { message : "Proxy table in '.proxyrc' should be of object type. Skipping..." } ) ; return this ; } for ( const [ context , options ] of Object . entries ( cfg ) ) app . use ( $d5ec61ae293989fa$exports . createProxyMiddleware ( context , options ) ) ; } return this ; }
Load proxy table from package.json and apply them.
Load proxy table from package . json and apply them .
// avoid skipping project root // each key is interpreted as context, and value as middleware options