npm - onchange 的问题,它无法识别 scss 文件的更改
问题描述
我将 onchange 插件安装到我的项目中,但是当我在 npm 上执行“watch:scss”时,我无法让脚本运行,它只是没有检测到我的文件有任何更改,可能是语法错误,但我检查了很多的时候,希望有人可以帮助:)
{
"name": "guia-hoteles",
"version": "1.0.0",
"description": "Primer proyecto de Node.js",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "lite-server",
"scss": "node-sass -o css/ css/",
"watch:scss": "onchange 'css/*.scss' -- npm run scss ",
"start": "concurrently \"npm run watch:scss\" \"npm run dev\""
},
"repository": {
"type": "git",
"url": "git+https://juani_olguin@bitbucket.org/juani_olguin/guia-hoteles.git"
},
"author": "Juan Ignacio Olguin",
"license": "ISC",
"homepage": "https://bitbucket.org/juani_olguin/guia-hoteles#readme",
"devDependencies": {
"lite-server": "^2.5.4",
"node-sass": "^4.14.1",
"onchange": "^7.0.2",
"rimraf": "^3.0.2"
},
"dependencies": {
"@popperjs/core": "^2.5.3",
"bootstrap": "^4.5.2",
"concurrently": "^5.3.0",
"jquery": "^3.5.1",
"open-iconic": "^1.1.1",
"popper.js": "^1.16.1"
}
}
解决方案
如果你使用的是Windows,基本上你只需要用双引号改变单引号并将双引号转义,如下所示:
"watch:scss": "onchange \\"css/*.scss\\" -- npm run scss ",
推荐阅读
- c++ - 是否允许在 decltyped 的变量的初始化程序中使用 decltype?
- javascript - 收听元数据 Firestore
- jquery - 如何将数据从我的 Ajax 函数传递到局部视图中的 HTML 模型?
- arrays - 如何使用数组将范围加入格式化字符串
- r - R中用于捕获名称和段落的正则表达式
- angular - VSCode 无法识别的单元测试的 Angular 类型定义
- python - tkinter 应用程序使用 MVC 旋转 2 个窗口
- pic - CAN MCP2515 - 环回模式通过 CAN 总线发送消息?
- sql - 在 SQL/PSQL 中更新语句
- r - R函数read.csv在第一个标题名称中插入ï..