Andy-set-studio / learneleventyfromscratch.com

In this Eleventy course, we go from a completely empty directory to a full-blown marketing site for a design agency, and along the way, we dive really deep into Eleventy and front-end development best practices.
https://learneleventyfromscratch.com/
120 stars 28 forks source link

gulp-sass doesn't have a default Sass compiler #6

Open abenjamin765 opened 2 years ago

abenjamin765 commented 2 years ago

In the sass.js file, const sassProcessor = require('gulp-sass'); needs to also define the sass compiler.

ex: const sassProcessor = require('gulp-sass')(require('sass'));

Andy-set-studio commented 2 years ago

Yeh this is a big reason why I'm planning to rip out the gulp stuff, at some point. It's in short, a pain in the ass

jalwn commented 2 years ago

I am using gulp ^4.0.2 as I had issues with the version recommended in the course. Is gulp still widely used or is it not needed?

koitaki commented 2 years ago

Fwiw, I tried re-writing the gulp stuff using Max Böck's 11ty.js templates. https://mxb.dev/blog/eleventy-asset-pipeline/ For the most part it worked well. But I ran into a problem when I tried to use eleventy's pagination feature to generate the files for criticial.css, home.css, page.css. It wanted to generate them straight into the dist folder, rather than back into the production src folder. I currently don't have the competency to solve that issue, but I'd guess it's possible. Eg. maybe with the Eleventy docs inlining approach? https://www.11ty.dev/docs/quicktips/inline-css/ Possibly helped with the beforeBuild event? https://www.11ty.dev/docs/events/#beforebuild

jbbenavidesr commented 2 years ago

The approach I've been trying lately is with Chris Ferdinandi's Boilerplate. Using only the part of sass and images, and adding a script for the fonts could be a good alternative.

I could try a proposal to implement it, however for the explanation part I don't think I'm the greatest fit as I'm still getting my head around build tools myself.

nnagewad commented 2 years ago

I came across a video on Egghead.io

Not as elegant, but a possible strating point.