【发布时间】:2020-12-20 08:13:42
【问题描述】:
在我的 Angular 应用程序中,我尝试创建一个 dist 文件夹,其中包含 scripts,而 index.html 放置在根文件夹中。这可以通过一些标志选项来实现。我尝试通过将其添加到我的 package.json 脚本中来自动执行此操作,但我的语法似乎不完整或错误。
脚本的前半部分工作正常,但第二部分却不行。当我单独执行move 脚本时,它工作正常。如何修复我的语法以便移动脚本也能运行?
当前脚本:
"build:prod": "ng build --prod --output-path=\"dist/scripts\" --deployUrl=\"scripts/\" && move ./dist/scripts/index.html ./dist"
我的开发环境在 Windows 10
【问题讨论】:
-
尝试
mv而不是move并获得管理员权限 -
@Greedo 是对的,move 不是系统命令,如果是你在 package.json 中写的脚本你需要写成
"build:prod": "ng build --prod --output-path=\"dist/scripts\" --deployUrl=\"scripts/\" && npm run move ./dist/scripts/index.html ./dist" -
感谢您的回复!抱歉,我忘了提到我在
Windows....不确定mv是否会这样工作?
标签: javascript angular package.json