Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compile CSS with Parcel CSS
const css = require("@parcel/css");
module.exports = (eleventyConfig) => {
eleventyConfig.addTemplateFormats("css");
eleventyConfig.addExtension("css", {
outputFileExtension: "css",
compile: (contents, inputPath) => {
return (data) => {
let ret = css.bundle({
filename: inputPath,
minify: true,
});
return ret.code;
};
},
});
//...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment