- Notifications
You must be signed in to change notification settings - Fork 980
/
Copy pathvite.config.mjs
42 lines (41 loc) · 933 Bytes
/
vite.config.mjs
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
import{defineConfig}from'vite'
importvuefrom'@vitejs/plugin-vue'
importpathfrom'node:path'
importautoprefixerfrom'autoprefixer'
exportdefaultdefineConfig(()=>{
return{
plugins: [vue()],
base: './',
css: {
postcss: {
plugins: [
autoprefixer({}),// add options if needed
],
},
},
resolve: {
alias: [
// webpack path resolve to vitejs
{
find: /^~(.*)$/,
replacement: '$1',
},
{
find: '@/',
replacement: `${path.resolve(__dirname,'src')}/`,
},
{
find: '@',
replacement: path.resolve(__dirname,'/src'),
},
],
extensions: ['.mjs','.js','.ts','.jsx','.tsx','.json','.vue','.scss'],
},
server: {
port: 3000,
proxy: {
// https://vitejs.dev/config/server-options.html
},
},
}
})