-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eleventy.js
38 lines (34 loc) · 1.35 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
const htmlmin = require('html-minifier')
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({ 'src/assets/js/service-worker.js': 'service-worker.js' })
eleventyConfig.addPassthroughCopy("src/assets");
eleventyConfig.addPassthroughCopy("src/favicon.ico");
eleventyConfig.addPassthroughCopy("src/android-chrome-192x192.png");
eleventyConfig.addPassthroughCopy("src/android-chrome-512x512.png");
eleventyConfig.addPassthroughCopy("src/apple-touch-icon.png");
eleventyConfig.addPassthroughCopy("src/browserconfig.xml");
eleventyConfig.addPassthroughCopy("src/favicon-16x16.png");
eleventyConfig.addPassthroughCopy("src/favicon-32x32.png");
eleventyConfig.addPassthroughCopy("src/mstile-150x150.png");
eleventyConfig.addPassthroughCopy("src/safari-pinned-tab.svg");
eleventyConfig.addPassthroughCopy("src/site.webmanifest");
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
// Eleventy 1.0+: use this.inputPath and this.outputPath instead
if( outputPath && outputPath.endsWith(".html") ) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
return minified;
}
return content;
})
return {
passthroughFileCopy: true,
dir: {
input: "src",
output: "public"
}
};
};