所以我在 npm 包脚本中运行任务,但我想在npm start
.
这有效:
"scripts": {
"scss": "node-sass src/style.scss dist/style.css -w"
}
这不会编译、观察或抛出任何错误:
"scripts": {
"scss": "node-sass src/style.scss dist/style.css",
"start": "parallelshell \"npm run scss -- -w\""
}
没有parallelshell 或者没有速记都不能工作。
我认为问题是运行脚本在引号中传递了额外的参数,所以命令的输出如下:
node-sass src/style.scss dist/style.css "-w"
我希望它能够在不添加任何依赖项的情况下工作。我错过了什么?
顺便说一句,我在带有命令提示符/git bash 的 Windows 10 中。