-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheleventy.config.cjs
51 lines (47 loc) · 1.29 KB
/
eleventy.config.cjs
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
const EleventyVitePlugin = require("@11ty/eleventy-plugin-vite");
const postCss = require("postcss");
const postcssPresetEnv = require("postcss-preset-env");
const cssnano = require("cssnano");
const path = require("path");
module.exports = function (eleventyConfig) {
eleventyConfig.setServerPassthroughCopyBehavior("copy");
eleventyConfig.addPassthroughCopy({ "assets/images": "img" });
eleventyConfig.addPassthroughCopy({ "assets/css": "css" });
eleventyConfig.addWatchTarget("assets/**/*.scss");
eleventyConfig.addPlugin(EleventyVitePlugin, {
serverOptions: {
port: 9090,
},
viteOptions: {
clearScreen: true,
server: {
mode: "development",
middlewareMode: true,
},
css: {
devSourceMap: true,
postcss: {
plugins: [postcssPresetEnv(), cssnano({ preset: "default" })],
},
},
build: {
mode: "production",
sourcemap: true,
manifest: true,
},
resolve: {
alias: {
"~icons": path.resolve(__dirname, "node_modules/bootstrap-icons"),
"/node_modules": path.resolve(__dirname, "node_modules"),
},
},
},
});
return {
templateFormats: ["njk"],
dir: {
layouts: "_layouts",
includes: "_includes",
},
};
};