-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
59 lines (48 loc) · 1.73 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const EleventyVitePlugin = require('@11ty/eleventy-plugin-vite');
const EleventyWebcPlugin = require('@11ty/eleventy-plugin-webc');
module.exports = function (config) {
config.addPlugin(EleventyVitePlugin);
config.addPlugin(EleventyWebcPlugin, {
components: 'src/_includes/components/**/*.html',
});
// Static assets to pass through
config.addPassthroughCopy('./src/images');
config.addPassthroughCopy('./src/public');
config.addPassthroughCopy('./src/styles');
config.addPassthroughCopy('./src/main.js');
config.setServerOptions({
// Default values are shown:
// Whether the live reload snippet is used
liveReload: true,
// Whether DOM diffing updates are applied where possible instead of page reloads
domDiff: true,
// The starting port number
// Will increment up to (configurable) 10 times if a port is already in use.
port: 8080,
// Additional files to watch that will trigger server updates
// Accepts an Array of file paths or globs (passed to `chokidar.watch`).
// Works great with a separate bundler writing files to your output folder.
// e.g. `watch: ["_site/**/*.css"]`
watch: [],
// Show local network IP addresses for device testing
showAllHosts: false,
// Use a local key/certificate to opt-in to local HTTP/2 with https
https: {
// key: "./localhost.key",
// cert: "./localhost.cert",
},
// Change the default file encoding for reading/serving files
encoding: 'utf-8',
});
return {
dir: {
input: 'src',
output: '_site',
},
passthroughFileCopy: true,
templateFormats: ['html', 'md', 'webc'],
htmlTemplateEngine: 'webc',
dataTemplateEngine: 'webc',
markdownTemplateEngine: 'webc',
};
};