onchange 的问题,它无法识别 scss 文件的更改
Problem with onchange, it isn't recognizing scss files changes
我在我的项目中安装了 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"
}
}
this is what git looks like when I run the script
如果你使用的是Windows,基本上你只需要将单引号换成双引号并转义双引号,就像这样:
"watch:scss": "onchange \"css/*.scss\" -- npm run 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"
}
}
this is what git looks like when I run the script
如果你使用的是Windows,基本上你只需要将单引号换成双引号并转义双引号,就像这样:
"watch:scss": "onchange \"css/*.scss\" -- npm run scss ",