-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
40 lines (31 loc) · 890 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
36
37
38
39
40
const htmlmin = require('html-minifier')
const addFilters = require('./src/eleventy/filters')
const addShortcodes = require('./src/eleventy/shortcodes')
module.exports = (eleventyConfig) => {
addFilters(eleventyConfig)
addShortcodes(eleventyConfig)
eleventyConfig.addWatchTarget('./src/styles')
eleventyConfig.addPassthroughCopy({ 'src/assets': 'assets' })
eleventyConfig.addTransform('htmlmin', (content, outputPath) => {
if (outputPath && outputPath.endsWith('.html')) {
return htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true
})
}
return content
})
eleventyConfig.setBrowserSyncConfig({
port: 3000
})
return {
dir: {
input: 'src/templates',
output: 'public',
data: '../data',
},
}
}