-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.ts
45 lines (42 loc) · 1.28 KB
/
_config.ts
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
import lume from "lume/mod.ts";
import postcss from "lume/plugins/postcss.ts";
import sass from "lume/plugins/sass.ts";
import esbuild from "lume/plugins/esbuild.ts";
import codeHighlight from "lume/plugins/code_highlight.ts";
import { htmlMinifier } from "https://raw.githubusercontent.com/xHyroM/xHyroM/master/packages/site/plugins/htmlMinifier.ts";
import resolveUrls from "lume/plugins/resolve_urls.ts";
import cacheBusting from "lume/middlewares/cache_busting.ts";
const site = lume({
src: "./src",
server: {
page404: "./404/",
middlewares: [cacheBusting({})],
},
});
site.ignore("README.md")
.copy("static", ".")
.loadAssets([".html"])
.use(resolveUrls())
.use(htmlMinifier())
.use(sass())
.use(codeHighlight())
.use(postcss())
.use(
esbuild({
options: {
bundle: true,
keepNames: true,
minify: false,
minifyWhitespace: true,
minifySyntax: true,
platform: "browser",
},
})
)
.scopedUpdates(
(path) => path.endsWith(".css"),
(path) => path.endsWith(".png") || path.endsWith(".jpg")
)
// Filters
.filter("slice", (arr, length) => arr.slice(0, length));
export default site;