-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
36 lines (31 loc) · 1.15 KB
/
.eleventy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import postcss from "postcss";
import tailwindcss from "tailwindcss";
import autoprefixer from "autoprefixer";
import tailwindConfig from "./tailwind.config.js";
import filters from "./filters.js";
import interlinker from "@photogabble/eleventy-plugin-interlinker";
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
export default function (eleventyConfig) {
filters(eleventyConfig);
eleventyConfig.addPassthroughCopy("src/assets");
eleventyConfig.addPassthroughCopy("CNAME");
// Wire tailwind in with postcss to avoid additional wrappers to the build + serve processes
// kudos: https://medium.com/@grahamrb/combining-eleventy-with-tailwind-css-and-daisyui-9b87c3f40d67
eleventyConfig.addNunjucksAsyncFilter("postcss", (cssCode, done) => {
postcss([tailwindcss(tailwindConfig), autoprefixer()])
.process(cssCode)
.then(
(r) => done(null, r.css),
(e) => done(e, null),
);
});
eleventyConfig.addWatchTarget("assets/*.css");
eleventyConfig.addPlugin(interlinker, {});
eleventyConfig.addPlugin(syntaxHighlight, {});
return {
dir: {
input: "src",
output: "_site",
},
};
}