-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
45 lines (40 loc) · 1.72 KB
/
vite.config.js
File metadata and controls
45 lines (40 loc) · 1.72 KB
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 { globSync } from 'glob';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
// config options
export default {
// Complete documentation of Vite configuration on
// https://vitejs.dev/config/
// Change to the name of your repository
// According to https://vitejs.dev/guide/static-deploy.html
base: '/Geo_Slide_Map/',
publicDir: "public",
// Options for the build command
build: {
// The name of the folder to which the build is stored.
// As the folder that github pages expects is /docs, we export to /docs folder.
outDir: 'docs',
// This builds the dependencies and bundles using the different imports from the pages.
// It uses index.html as the main entrypoint.
// Also adds every html file inside the /pages folder.
// Further pages must be added to the configuration accordingly.
rollupOptions: {
input: {
main: 'index.html',
...Object.fromEntries(
globSync('pages/*.html').map(file => [
// This remove `pages/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
path.relative(
'pages',
file.slice(0, file.length - path.extname(file).length)
),
// This expands the relative paths to absolute paths, so e.g.
// src/nested/foo becomes /project/src/nested/foo.js
fileURLToPath(new URL(file, import.meta.url))
])
),
},
},
}
}