-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
52 lines (46 loc) · 1.37 KB
/
vite.config.ts
File metadata and controls
52 lines (46 loc) · 1.37 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
46
47
48
49
50
51
52
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { SitemapStream } from 'sitemap'
import { createWriteStream } from 'fs'
export default defineConfig({
plugins: [
vue(),
{
name: 'generate-sitemap',
closeBundle: async () => {
const sitemap = new SitemapStream({ hostname: 'https://quickarchive.co.kr' })
const writeStream = createWriteStream('./dist/sitemap.xml')
sitemap.pipe(writeStream)
const routes = [
{ url: '/', changefreq: 'monthly', priority: 1.0 },
{ url: '/login', changefreq: 'monthly', priority: 0.8 },
{ url: '/main', changefreq: 'daily', priority: 0.9 },
{ url: '/main/search', changefreq: 'daily', priority: 0.8 },
{ url: '/main/setting', changefreq: 'monthly', priority: 0.6 },
{ url: '/main/setting/myinfo', changefreq: 'monthly', priority: 0.6 }
]
routes.forEach((route) => {
sitemap.write(route)
})
sitemap.end()
}
}
],
base: '/',
define: {
'process.env': process.env
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "/src/assets/scss/abstracts/_variables.scss";`
}
}
}
})