WPGulp icon indicating copy to clipboard operation
WPGulp copied to clipboard

Not watching SCSS changes on new installations

Open AndreaBarghigiani opened this issue 5 years ago • 7 comments

Bug Report

I have installed WPGulp with npx wpgulp on a fresh theme and start using it with npm start after I've edited the wpgulp.config.js file but when I save some changes on my SCSS files Gulp does not compile them in a new style.css file.

Expected Behavior

Watching any changes in my SCSS files.

Actual Behavior

WPGulp runs once when I type npm start and does not run the styles task when I edit my SCSS files.

Steps to Reproduce

  1. install with npx wpgulp
  2. (optional) edit configuration in wpgulp.config.js
  3. run npm start

Packages versions

  1. node -v: v10.16.0
  2. npm -v: 6.9.0

Then, specify:

  1. Operating system: MacOS Mojave 10.14.6

Possible Solution The strange thing is that if I take package.json, gulpfile.babel.js and wpgulp.config.js from an older project where everything works just fine and I run npm install, after the installation is completed, when I run npm start everything works just fine.

Those are the files that I import: wpgulp-files.zip

I've also tried to run npx install-wpgulp on this working project to update my files with the latest version but the update make my WPGulp stop watching for file changes.

I've also checked for differences between the downloaded files and the working ones but, except variable values and small syntax changes, I do not see any relevant.

AndreaBarghigiani avatar Nov 18 '19 17:11 AndreaBarghigiani

Having the exact same issue:

node -v: v11.15.0 npm -v: 6.10.3 Operating system: MacOS Mojave 10.14.6

wazynski avatar Mar 02 '20 16:03 wazynski

Is this still a thing?

CatinhoCR avatar Apr 10 '20 10:04 CatinhoCR

It's still an issue: BigSur 11.1 npm -v 6.14 node -v 14.15.4

chstappert avatar Jan 15 '21 23:01 chstappert

It's still an issue: BigSur 11.1 npm -v 6.14 node -v 14.15.4

Got it running. The "const watchStyles" wasn't correctly set. Now it works perfectly! Great tool.

chstappert avatar Jan 16 '21 21:01 chstappert

It's still an issue: BigSur 11.1 npm -v 6.14 node -v 14.15.4

Got it running. The "const watchStyles" wasn't correctly set. Now it works perfectly! Great tool.

What did you change it too??

jvanstone avatar Feb 16 '21 17:02 jvanstone

@jvanstone The fix mentioned by @chstappert worked for me. The watchStyles was set to const watchStyles = './assets/css/**/*.scss'; whereas I'm putting all my scss files inside assets/scss so I simply changed it to const watchStyles = './assets/scss/**/*.scss'; Thanks!

Web-Assembler avatar Apr 25 '21 16:04 Web-Assembler

@jvanstone The fix mentioned by @chstappert worked for me. The watchStyles was set to const watchStyles = './assets/css/**/*.scss'; whereas I'm putting all my scss files inside assets/scss so I simply changed it to const watchStyles = './assets/scss/**/*.scss'; Thanks!

@Web-Assembler thanks the response. I was able to get it to work too. Thanks!

jvanstone avatar Apr 26 '21 11:04 jvanstone