-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
34 lines (32 loc) · 838 Bytes
/
vite.config.js
File metadata and controls
34 lines (32 loc) · 838 Bytes
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
import { resolve } from "node:path";
import { defineConfig } from "vite";
import {
buildInjectScripts,
serverInjectScripts,
} from "./plugin/inject-scripts";
import { htmlMinifierPlugin } from "vite-plugin-html-minifier";
const BASE_URL = "/dev-challenges/qr-code-generator";
// https://vite.dev/config/
export default defineConfig({
plugins: [
// TODO: merge inject plugins into one plugin that returns an array of plugins
serverInjectScripts(BASE_URL),
buildInjectScripts(BASE_URL),
htmlMinifierPlugin(),
],
base: BASE_URL,
build: {
rollupOptions: {
input: {
main: "index.html",
qr_code: "qr-code/index.html",
},
},
},
resolve: {
alias: {
// https://nodejs.org/api/esm.html#importmetadirname
"@": resolve(import.meta.dirname, "src"),
},
},
});