![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/dceprojects.corals.io/node_modules/webpack-dev-server/lib/utils/ |
'use strict'; const open = require('opn'); const isAbsoluteUrl = require('is-absolute-url'); function runOpen(uri, options, log) { // https://github.com/webpack/webpack-dev-server/issues/1990 let openOptions = { wait: false }; let openOptionValue = ''; if (typeof options.open === 'string') { openOptions = Object.assign({}, openOptions, { app: options.open }); openOptionValue = `: "${options.open}"`; } else if (typeof options.open === 'object') { openOptions = options.open; openOptionValue = `: "${JSON.stringify(options.open)}"`; } const pages = typeof options.openPage === 'string' ? [options.openPage] : options.openPage || ['']; return Promise.all( pages.map((page) => { const pageUrl = page && isAbsoluteUrl(page) ? page : `${uri}${page}`; return open(pageUrl, openOptions).catch(() => { log.warn( `Unable to open "${pageUrl}" in browser${openOptionValue}. If you are running in a headless environment, please do not use the --open flag` ); }); }) ); } module.exports = runOpen;