-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.js
40 lines (36 loc) · 889 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
import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
import { createVuePlugin } from 'vite-plugin-vue2'
import viteCompression from 'vite-plugin-compression';
import path from 'path';
const HOST = "0.0.0.0"
const REPLACEMENT = `${path.resolve(__dirname, './src')}/`
export default (/** if you want to use mode : { mode }*/) => {
return defineConfig({
base: "./",
server: {
host: HOST,
port: process.env.PORT,
},
resolve: {
alias: [
{
find: '@/',
replacement: REPLACEMENT,
},
{
find: 'src/',
replacement: REPLACEMENT,
},
],
},
plugins: [
createVuePlugin(/* options */),
legacy({
targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
}),
viteCompression()
],
})
}