Hey Team, I’m having a very vexing issue getting Jekyll to watch and auto regenerate sass files. Watch sees changes I make to html just fine. If I restart the jekyll server, it will then see and make the sass changes. But this work around is not ideal. I’ve gone through every suggestion at this older post: https://github.com/jekyll/jekyll-watch/issues/10 and found numerous other older pages that were also no avail.
I’ve reinstalled jekyll and jekyll watch. I’m using versions 3.6.0 and 1.5.0 respectively. I’m using OSX Sierra. If it matters, I’m using this in conjunction with Bootstrap 4.0.0 dev version. For the sake of completeness, here’s my Gem list:
your sass files are in the _sass folder?
are you using any plugins like jekyll assets (doesn’t look like it from your list)?
I would make a new site and see if it works in there just to see if you can narrow it down - if it works with the default site then maybe there is something wrong with your BS sass structure.
I can highly recommend using Gulp to either do the watch and regenerate with live reloading of the browser or to take on the whole sass and asset processing parts away from jekyll.
rdyar, thanks for the response. Actually you’ve pointed out an aspect of my setup that I should have brought up in my initial post. I have the following in _config.yml:
I will have at least 5 single page sites (located in their own folders) that belong to the same campaign. I’ll be creating these in their own folders within the larger Bootstrap installation. Since I need to monitor sass changes in each folder I’m using the load_paths approach vs the sass_dir: _sass.
My scss files reside in the folders labeled “style” above. I have experimented with also setting the sass_dir option like such:
those don’t look like they are indented properly - is that just the way they copied in or are they really like that in you config?
I had no problem with sass with jekyll but it was not nested like that.
As for gulp here is something i used to use that is fairly simple:
you would need to have node installed, and then it looks like I left out the package.json file that would load the couple things required by gulp - as well as gulp itself.
I also just made this post which links to another page on my site about what I am doing now - and in that thread is also a link to a post from @mmistakes about the same thing - though he is way ahead of me.
Thanks again for the assist. The indentation was lost during the paste into this forum post. I tried following another web article regarding gulp and browser-sync. I got confused when I realized that setup wouldn’t also merge my includes into a single flat html file. I realized later I’d likely need to use both Jekyll AND Gulp, for flat files and sass + reloads respectively. That’s when I just went back to doing things the hard way. Sass save + quit server + restart server + refresh browser.
I’m going to utilize your posted gulpfile.js code but I’ll need to modify it to ignore a bunch of existing Bootstrap stuff. The other thing I notice is that Bootstrap already has a package.json file: https://github.com/twbs/bootstrap/blob/v4-dev/package.json
So I’m not sure what I would need to modify in the .json for purposes of running the aforementioned gulpfile.
I went ahead and ran $ gulp anyway, and got the following error:
I still think everyone works on windows, nice catch on that if statement, I should add that to mine so when I share it it is a little more workable.
You just need one package.json, but it needs to include all the dependencies for everything.Kind of sounds like what you needed was in it already. If it isn’t it will error and you can just manually install them until it works.