(commandOptions)
| 98 | }, |
| 99 | |
| 100 | async run(commandOptions) { |
| 101 | if (this.isViteProject) { |
| 102 | return Promise.reject( |
| 103 | new SilentError( |
| 104 | 'The `serve` command is not supported in Vite-based projects. Please use the `start` script from package.json.' |
| 105 | ) |
| 106 | ); |
| 107 | } |
| 108 | |
| 109 | commandOptions.liveReloadHost = commandOptions.liveReloadHost || commandOptions.host; |
| 110 | |
| 111 | let wrappedCommandOptions = await this._checkOrGetPort(commandOptions); |
| 112 | if (wrappedCommandOptions.proxy) { |
| 113 | if (!/^(http:|https:)/.test(wrappedCommandOptions.proxy)) { |
| 114 | let message = `You need to include a protocol with the proxy URL.${EOL}Try --proxy http://${wrappedCommandOptions.proxy}`; |
| 115 | |
| 116 | return Promise.reject(new SilentError(message)); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | await Win.checkIfSymlinksNeedToBeEnabled(this.ui); |
| 121 | await this.runTask('Serve', commandOptions); |
| 122 | }, |
| 123 | |
| 124 | async _checkOrGetPort(commandOptions) { |
| 125 | let portOptions = { port: commandOptions.port || DEFAULT_PORT, host: commandOptions.host }; |
nothing calls this directly
no test coverage detected