packages/cli: better HTTPS switch for bundle

This commit is contained in:
Patrik Oldsberg
2020-05-16 17:23:39 +02:00
parent 9a123ac0a9
commit c744f5e4a3
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -68,7 +68,8 @@
"tar": "^6.0.1",
"ts-loader": "^7.0.4",
"webpack": "^4.41.6",
"webpack-dev-server": "^3.10.3"
"webpack-dev-server": "^3.10.3",
"yn": "^4.0.0"
},
"devDependencies": {
"@types/diff": "^4.0.2",
+2 -1
View File
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import yn from 'yn';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import openBrowser from 'react-dev-utils/openBrowser';
@@ -30,7 +31,7 @@ export async function startDevServer() {
return;
}
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const protocol = yn(process.env.HTTPS, { default: false }) ? 'https' : 'http';
const urls = prepareUrls(protocol, host, port);
const paths = resolveBundlingPaths();