-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
40 lines (37 loc) · 967 Bytes
/
vite.config.ts
File metadata and controls
40 lines (37 loc) · 967 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
35
36
37
38
39
40
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import tailwindcss from "@tailwindcss/vite";
import vueDevTools from "vite-plugin-vue-devtools";
function isGithubUserOrOrganizationSite(repository: string): boolean {
const [user, repo] = repository.split("/");
return user === repo.replace(/.github.io$/, "");
}
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: _tag => false,
},
},
}),
tailwindcss(),
vueDevTools(),
],
// For organization sites (creatorsim.github.io), use root path
// For project sites (forks), use /repo-name/ path
base:
!process.env.REPO ||
isGithubUserOrOrganizationSite(process.env.GITHUB_REPOSITORY!)
? "/"
: process.env.REPO + "/",
publicDir: "public",
build: {
rollupOptions: {
input: {
main: "index.html",
},
},
copyPublicDir: true,
},
});