Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: close #176763, modify the conditions to load vscode-web-playground #176771

Merged
merged 5 commits into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions scripts/code-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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']);
Expand All @@ -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}/`);
Expand Down Expand Up @@ -145,5 +148,4 @@ async function ensureWebDevExtensions(verbose) {
}
}


main();