-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.js
47 lines (39 loc) · 841 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
37
38
39
40
41
42
43
44
45
46
47
import { defineConfig, loadEnv } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import { VitePWA } from 'vite-plugin-pwa'
import WindiCSS from 'vite-plugin-windicss'
import Pages from 'vite-plugin-pages'
export default defineConfig(() => {
const env = loadEnv(null, process.cwd())
return {
plugins: [
vue(),
WindiCSS(),
VitePWA(),
Pages({
dirs: 'resources/pages',
})
],
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}`)
}
}
}
})