-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
35 lines (30 loc) · 904 Bytes
/
.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
const pluginSass = require('eleventy-plugin-sass');
const htmlmin = require('html-minifier');
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(pluginSass, {
watch: ['src/assets/**/*.{scss,sass}'],
outputDir: 'dist/assets'
});
eleventyConfig.addTransform('htmlmin', function(content, outputPath) {
if (outputPath.endsWith('.html')) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
collapseWhitespace: true
});
return minified;
}
return content;
});
eleventyConfig.setTemplateFormats('html');
eleventyConfig.addPassthroughCopy('src/data');
eleventyConfig.addPassthroughCopy('src/assets/**/*.{js,png}');
eleventyConfig.addPassthroughCopy({ 'src/assets/favicons/*': '.' });
return {
dir: {
input: 'src',
output: 'dist',
data: 'data',
layouts: 'layouts'
}
}
};