forked from aisuda/vue2-amis-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
39 lines (37 loc) · 984 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
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: {
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"], // .vue added
alias: [
{
find: "@/",
replacement: REPLACEMENT,
},
{
find: "src/",
replacement: REPLACEMENT,
},
],
},
plugins: [
createVuePlugin(/* options */),
legacy({
targets: ["ie >= 11"],
additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
}),
viteCompression(),
],
});
};