From 8fc524d1612e035a17a5f0e466616079259dec12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=93=E8=89=AF?= <1204183885@qq.com> Date: Tue, 4 Apr 2023 17:16:42 +0800 Subject: [PATCH] fix: close #176763, modify the conditions to load vscode-web-playground (#176771) * fix: close #176763, modify the conditions to load vscode-web-playground * chore: use of recovery --no-playground parameters * chore(script): update the argument description * chore(script): update the argument description * chore(script): update the argument description --- scripts/code-web.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/code-web.js b/scripts/code-web.js index d91c6a08489..ec9cee76aee 100644 --- a/scripts/code-web.js +++ b/scripts/code-web.js @@ -41,8 +41,10 @@ async function main() { if (args.help) { console.log( - './scripts/code-web.sh|bat [options]\n' + - ' --playground Include the vscode-web-playground extension (added by default if no folderPath is provided)\n' + './scripts/code-web.sh|bat[, folderMountPath[, options]]\n' + + ' Start with an empty workspace and no folder opened in explorer\n' + + ' folderMountPath Open local folder (eg: use `.` to open current directory)\n' + + ' --playground Include the vscode-web-playground extension\n' ); startServer(['--help']); return; @@ -59,7 +61,9 @@ async function main() { if (args['port'] === undefined) { serverArgs.push('--port', PORT); } - if (args['playground'] === true || (args['_'].length === 0 && !args['folder-uri'])) { + + // only use `./scripts/code-web.sh --playground` to add vscode-web-playground extension by default. + if (args['playground'] === true) { serverArgs.push('--extensionPath', WEB_DEV_EXTENSIONS_ROOT); serverArgs.push('--folder-uri', 'memfs:///sample-folder'); await ensureWebDevExtensions(args['verbose']); @@ -75,7 +79,6 @@ async function main() { serverArgs.push(...process.argv.slice(2).filter(v => !v.startsWith('--playground') && v !== '--no-playground')); - startServer(serverArgs); if (openSystemBrowser) { opn(`http://${HOST}:${PORT}/`); @@ -145,5 +148,4 @@ async function ensureWebDevExtensions(verbose) { } } - main();