gpt4 book ai didi

gulp - 尝试使用不基于根文件夹的 VSCode 运行 gulp 任务

转载 作者:行者123 更新时间:2023-12-03 11:16:59 34 4
gpt4 key购买 nike

这是我的 task.json

// A task runner configuration for gulp. Gulp provides a less task
// which compiles less to css.
{
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"tasks": [
{
"taskName": "sfdcBuild",
// Make this the default build command.
"isBuildCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "always",
// Use the standard less compilation problem matcher.
"problemMatcher": "$lessCompile"
}
]
}

不幸的是,我的 gulp 安装(本地安装)不在根目录下,而是在另一个文件夹中:
root/js/

那么如何定义我想从另一个文件夹中运行这个 gulp 命令呢?

PS:将 task.json 移到子文件夹中也没有用。

最佳答案

部分支持使用不同的工作目录。它不适用于自动检测 gulp 任务,但它应该适用于运行 gulp。您可以将这样的内容添加到顶级范围内的 tasks.json

"options": {
"cwd": "${workspaceRoot}/mySubDir"
},

但是,这仍然假设 gulp 和 guld 需要的所有节点模块都可以从该目录访问。

关于gulp - 尝试使用不基于根文件夹的 VSCode 运行 gulp 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29996249/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com