-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
45 lines (44 loc) · 1.24 KB
/
rollup.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 { defineConfig } from "rollup"
import { Taproot } from "@taprootio/rollup-plugin-taproot"
import { NunjucksTemplateParser } from "@taprootio/nunjucks-template-parser"
import { MarkdownPageRenderer } from "@taprootio/markdown-page-renderer"
import postcss from "rollup-plugin-postcss"
import url from "postcss-url"
import typescript from "@rollup/plugin-typescript"
import { nodeResolve } from "@rollup/plugin-node-resolve"
import copy from "rollup-plugin-copy"
import cjs from "@rollup/plugin-commonjs"
export default defineConfig({
input: "./site/main.ts",
plugins: [
cjs(),
nodeResolve(),
typescript(),
postcss({
plugins: [
url({
url: "inline",
}),
],
}),
Taproot({
PageRenderers: [MarkdownPageRenderer],
PagesPath: "site/pages",
TemplateParsers: [NunjucksTemplateParser],
TemplatesPath: "site/templates",
}),
copy({
targets: [
{ src: "site/assets/**/*", dest: "dist/assets" },
{ src: "site/favicons/**/*", dest: "dist" },
],
}),
],
output: {
dir: "dist",
sourcemap: true,
assetFileNames: "[name]-[hash][extname]",
chunkFileNames: "[name]-[hash][extname]",
entryFileNames: "[name]-[hash].js",
},
})