-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
66 lines (64 loc) · 1.37 KB
/
vite.config.ts
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import type { UserConfig, ConfigEnv } from "vite";
import { resolve } from "path";
import vue from "@vitejs/plugin-vue";
import htmlPlugin from "vite-plugin-html-config";
import type { Options } from "vite-plugin-html-config";
const htmlPluginOpt: Options = {
metas: [
{
name: "keywords",
content: "mitojs vue3-sdk-demo",
},
{
name: "description",
content: "mitojs vue3-sdk-demo",
},
],
};
function pathResolve(dir: string) {
return resolve(process.cwd(), ".", dir);
}
export default ({ command, mode }: ConfigEnv): UserConfig => {
return {
base: "/vue3-sdk-demo",
esbuild: {},
resolve: {
alias: [
{
find: /\/#\//,
replacement: pathResolve("types") + "/",
},
{
find: "@",
replacement: pathResolve("src") + "/",
},
],
dedupe: ["vue"],
},
css: {
preprocessorOptions: {
less: {
modifyVars: {},
javascriptEnabled: true,
},
},
},
plugins: [vue(), htmlPlugin(htmlPluginOpt)],
server: {
host: true,
port: 8001,
},
build: {
target: "es2015",
outDir: "docs",
terserOptions: {
compress: {
keep_infinity: true,
drop_console: true,
},
},
brotliSize: false,
chunkSizeWarningLimit: 2000,
},
};
};