-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy path.eleventy.js
45 lines (38 loc) · 1.01 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
37
38
39
40
41
42
43
44
45
const directoryOutputPlugin = require("@11ty/eleventy-plugin-directory-output");
const sass = require('sass');
module.exports = function(eleventyConfig) {
eleventyConfig.setQuietMode(true);
eleventyConfig.addPlugin(directoryOutputPlugin, {
columns: {
filesize: true,
benchmark: true,
},
warningFileSize: 50 * 1000,
});
// Sass pipeline
eleventyConfig.addTemplateFormats("scss");
eleventyConfig.addExtension("scss", {
outputFileExtension: "css",
compile: function(contents, includePath) {
let includePaths = [this.config.dir.includes];
return () => {
let ret = sass.renderSync({
file: includePath,
includePaths,
data: contents,
outputStyle: "compressed"
});
return ret.css.toString("utf8");
}
}
});
// Pass through assets
eleventyConfig.addPassthroughCopy({ "src/assets": "/" });
return {
dir: {
input: "src/site",
includes: "_includes",
output: "dist"
},
};
}