forked from mihatorikei/ci-svelte-appstarter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
37 lines (33 loc) · 785 Bytes
/
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
import { defineConfig, loadEnv } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import WindiCSS from 'vite-plugin-windicss'
import path from 'path'
export default defineConfig(() => {
const env = loadEnv(null, process.cwd())
return {
plugins: [
svelte(),
WindiCSS()
],
build: {
emptyOutDir: false,
outDir: './public/',
assetsDir: env.VITE_BUILD_DIR,
manifest: true,
rollupOptions: {
input: `./${env.VITE_RESOURCES_DIR}/${env.VITE_ENTRY_FILE}`
}
},
server: {
origin: env.VITE_ORIGIN,
port: env.VITE_PORT,
strictPort: true,
hmr: true
},
resolve: {
alias: {
'@': path.resolve(__dirname, `./${env.VITE_RESOURCES_DIR}`)
}
}
}
})