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

Consider adding default tasks.json and launch.json for VS Code #115

Open
segevfiner opened this issue Jun 22, 2022 · 1 comment
Open

Consider adding default tasks.json and launch.json for VS Code #115

segevfiner opened this issue Jun 22, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@segevfiner
Copy link

For example:

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "npm: dev",
            "type": "npm",
            "script": "dev",
            "detail": "vite",
            "problemMatcher": "$vite",
            "isBackground": true,
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "reveal": "never",
            }
        },

    ]
}

launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}",
            "preLaunchTask": "npm: dev"
        }
    ]
}

This is also a good opportunity to figure out any useful additional properties & tasks that can be useful to devs getting started with Vue & Vite.

@segevfiner
Copy link
Author

segevfiner commented Aug 28, 2022

Another thing to consider is https://code.visualstudio.com/docs/editor/debugging#_automatically-open-a-uri-when-debugging-a-server-program, which will require defining running Vite as a debug configuration, instead of defining it as a task. This can handle dynamic port allocation. But it currently has a problem with ANSI escapes and can't have problem matcher patterns defined in case we ever want to add any.

See microsoft/vscode#159391. Problem matchers for debug configurations or serverReadyAction for tasks might have been requested before.

@haoqunjiang haoqunjiang added the enhancement New feature or request label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants