dotnet / dotnet/project-system
Provide an option to launch external scripts via launchSettings.json
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
Currently in Visual Studio 2022 there's no way to execute debug tasks/scripts when testing an ASP.NET Core app locally.
It would be beneficial to be able to launch external tools/scripts/watchers _in addition to the main application_, when debug session is being started (mainly - watchers)
Examples:
* launch an npm file-watcher task that compiles LESS/SASS/CSS files
* launch an npm watcher that minifies JS files
* launch tailwind-cli process that scans the code for unused utility classes
* etc. etc.
In modern front-end almost everything is being _BUILT_. Tailwind CSS generates a file, TypeScript is compiled to JavaScript etc.etc. To enable live-reload we need file-watchers to launch these builds. And in Visual Studio there's literally no way to run, for example, a simple npm script when I start debugging a web app.
The only thing we have are MSBuild events, but they can't be used to launch long-running tasks (like file watchers) in parallel with debug.
Currently, if you're a front-end dev that makes a lot of changes to CSS/JS, the only way to update the browser is to run `npm run build` every time you make any change in your files. This is painful. Or - stop and restart the app altogether, to re-run all the MSBuild scripts.
P.S, Another option would be to offer us a way to hook into Hot Reload events and add custom commands there.
Contributor guide
Assessment
This issue has not been assessed yet.