我有以下项目的文件夹结构(这是一个开源的引导主题):

在package.json中,我有以下命令:
"watch": "nodemon -e scss -x \"npm run build\"",当我运行npm运行时,它会删除dist文件夹。这背后的原因是什么。一旦删除dist文件夹,css就无法工作,因为它位于其中。如何解决这个问题?为什么npm运行手表删除dist目录?
更新:
在从这里安装了grunt手表并在本地和全球安装了grunt之后,现在我在我的终端中获得了这个输出:
PS C:\PROJECTS\Bootsrap\bootstrap-magic> grunt watch
>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jshint" not found. Is it installed?
>> Local Npm module "grunt-contrib-qunit" not found. Is it installed?
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed?
>> Local Npm module "grunt-html-validation" not found. Is it installed?
>> Local Npm module "grunt-jekyll" not found. Is it installed?
>> Local Npm module "grunt-contrib-less" not found. Is it installed?
Running "watch" task
Waiting...发布于 2018-05-25 12:38:14
查看属于您所引用的包的package.json中的package.json节点:
"scripts": {
"prod": "npm run build && ./node_modules/.bin/serve ./dist --single",
"dev": "./node_modules/serve/bin/serve.js",
"clean": "rimraf dist",
"watch": "nodemon -e scss -x \"npm run build\"",
"build": "npm run clean && NODE_ENV=production webpack"
}watch脚本运行build,运行clean,它使用rimraf删除dist文件夹。
https://stackoverflow.com/questions/50526691
复制相似问题