-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
npm script not detected if the package.json is not in root folder #31217
Comments
Might it not be better to specify the rootDir of the package.json you're looking for in the task? Akin to the options object in other types of task. NVM: Just seen the path property. And this as about auto-detection. Ignore me |
Actualy, trying this out, the path property doesn't seem to work even on specified tasks. May or may not be related. If not related, I'll add a separate issue. |
Sorry for not replying or adding information to this issue, I am in the middle of moving home and have very limited PC access for a couple of weeks. |
I have same problem.
I have two TypeScript project each client and host directories. I defined npm task each package.json(client and host).
I opend these projects with VSCode as multi-workspace-projects and I tried to show task list with ">Tasks: Run Task".
So I switched to open each one project with VSCode in the terminal.
And did the same thing as above. Then I could see a npm task (npm:build) which I defined in package.json I guess VSCode does not auto-detect npm tasks when it is opend as multi-workspace-projects. Thank you. |
The task provider is now searching for package.json file inside the workspace with the exception of node_modules. Additional exclusions can be defined using the npm.exclude setting. |
To verify:
|
I think the problem of people having projects in sub-folders is much wider than just here. I've proposed that sub-folders should be able to be full-fledged WorkspaceFolders so they can have their own settings, debug configs, etc. here -> #45399 I think it'd solve a bunch of issues! |
I think this has caused a regression in performance and usability in large repositories. The change here a6dde81#diff-3b21ed98f2447f0d29ed636bdcf00c98R103 is calling In my large workspaces I have disabled all Before this change, my default build task started running immediately. |
Github doesn't seem to link to diff lines properly, this is the line that I believe is causing the slowdown with a call to |
When the package.json file is in a sub folder of the one opened in VSCode (therefore not in the root), the tasks in the scripts section are not auto detected. I did test opening VSCode with the folder that contains the package.json file directly and the tasks were autodetected correctly, it just seems to be if its in a parent folder that the issue is caused.
This might be expected behaviour, although in the same project I had a tsconfig.json file in the same folder as package.json and it was detected in a subfolder when the package.json tasks were not detected. Ideally it would be better to autodetect in a sub folder like the tsconfig.json file does.
Steps to Reproduce:
Reproduces without extensions: Yes
Thank you, apologies if I missed something
The text was updated successfully, but these errors were encountered: