-
-
Save ictus4u/2b20a4a91454a0b481b64a7f1913555e to your computer and use it in GitHub Desktop.
Simple SCSS pipeline for 11ty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const util = require('util'); | |
const sass = require('sass'); // `npm i -D sass` | |
const renderSass = util.promisify(sass.render); | |
const inputFile = '_includes/style.scss'; // the path to your main SCSS file | |
const outputFile = 'style.css'; // the filename you want this template to be saved as | |
module.exports = class { | |
data() { | |
return { | |
permalink: outputFile, | |
eleventyExcludeFromCollections: true, | |
}; | |
} | |
async render() { | |
const result = await renderSass({ | |
file: inputFile, | |
}); | |
return result.css; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment