-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 VS Code launcher and tasks for dotnet watch #10881
Conversation
This works perfectly without any issues now. |
"args": [ | ||
"gulp build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be npm run build instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never tried but that's for debugging the gulpfile.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this required gulp to be installed globally. npm run build
does not as it uses gulp from node_modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the default task suggested. npm run build will try to install it if not found every time whereas this will just execute what is needed knowing that it is already installed globally or locally. I don't mind changing it, but need to test it first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Npm run build does not install first as far as I know. It simply runs a script as defined in the package.json script section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. But then it will do the same if the gulp package is not installed. So, here it is just a task that executes the gulp build command to debug it without knowing if it's installed or not. What you suggest is to run the gulp pipeline by passing through npm which could lead to executing also something else than gulp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, we keep it there because it was there and I updated the task to comply with the latest VS Code tasks implementation details; but it's not something that we use much. Also, it is looking like we might need to move to WebPack or something else at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More on this. The actual VS Code launcher is expecting to get the gulp.js file from the local node_modules folder. The package.json file standing in the root folder of the project imports gulp ^4.0.2 so it is required to do an npm install before running this launcher for this to work else it will fail to find gulp.js.
{
"name": "Gulp Debug",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"runtimeArgs": [
"--nolazy"
],
"console": "internalConsole"
}
Is anyone interested in this pull request to be merged or should I remove the "dotnet watch" part of it? |
I like it. Personally I just have powershell alias so I can write |
Ok, well I will wait for someone to approve the PR 😄 |
WIP
dotnet watch
task.attach to process
work when usingdotnet watch
gulp build
taskdotnet run
task. Specifying a framework target since now we use multi-targetting.dotnet watch
launcher config so that we can also launch the browser automatically like before.The
dotnet watch
solution depends on :See https://github.com/Trottero/dotnet-watch-attach
VS Code Extension : https://marketplace.visualstudio.com/items?itemName=Trottero.dotnetwatchattach
Launchers
Tasks
orchard.mp4