-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
50 lines (47 loc) · 1.13 KB
/
vite.config.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
/** @format */
import {dirname, resolve} from "node:path";
import {fileURLToPath} from "node:url";
import {defineConfig} from "vite";
import generateFile from "vite-plugin-generate-file";
import handlebars from "vite-plugin-handlebars";
import config from "./src/lib/AuralogConfig.js";
import data from "./src/plugins/generate-files.js";
/** Directory of this package. */
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
build: {
rollupOptions: {
// Use auralog package index.html instead of process CWD
input: {
main: resolve(__dirname, "index.html"),
},
// Maintain output at process root instead of package (node_modules) root
output: {
dir: resolve(process.cwd(), "dist"),
},
},
},
plugins: [
generateFile([
{
type: "json",
output: "./headaches.json",
data,
},
]),
handlebars({
context: {
title: config?.html?.title,
description: config?.html?.description,
meta: config?.html?.meta,
allowRobots: config?.allowRobots,
},
}),
],
preview: {
open: "/",
},
server: {
open: "/node_modules/@troyv/auralog/index.html",
},
});