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
67
68
69
70
71
72
73
| import { defineConfig } from "vite";
| import vue from "@vitejs/plugin-vue";
| import path from "path";
| import Icons from "unplugin-icons/vite";
| import AutoImport from "unplugin-auto-import/vite";
| import Components from "unplugin-vue-components/vite";
| import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
| import DefineOptions from "unplugin-vue-define-options/vite";
| import { visualizer } from "rollup-plugin-visualizer";
| import legacy from "@vitejs/plugin-legacy";
|
| const isVisualizer = process.env.VISUALIZER === "show";
| export default defineConfig({
| base: "/",
| plugins: [
| vue(),
| Components({
| resolvers: [
| ElementPlusResolver(),
| ],
| }),
| AutoImport({
| imports: ["vue"],
| resolvers: [
| ElementPlusResolver(),
| ],
| }),
| Icons({
| autoInstall: true,
| }),
| DefineOptions(),
| isVisualizer && visualizer({ gzipSize: true }),
| legacy({
| targets: ["defaults", "not IE 11"],
| }),
| ],
| css: {
| preprocessorOptions: {
| scss: {
| additionalData: '@import "@/assets/css/global.scss";',
| },
| },
| },
| server: {
| },
| resolve: {
| alias: {
| "@": path.resolve(__dirname, "src"),
| "@comCommon": path.resolve(__dirname, "src/components/common"),
| "@comCompositeHome": path.resolve(
| __dirname,
| "src/components/compositeHome"
| ),
| "@comTrade": path.resolve(__dirname, "src/components/commonTrade"),
| "@comConstract": path.resolve(__dirname, "src/components/constract"),
| "@comSpot": path.resolve(__dirname, "src/components/spot"),
| "vue-i18n": "vue-i18n/dist/vue-i18n.cjs.js",
| },
| },
| build: {
| assetsDir: "static",
| rollupOptions: {
| input: {
| index: path.resolve(__dirname, "index.html"),
| },
| output: {
| chunkFileNames: "js/[name]-[hash].js",
| entryFileNames: "js/[name]-[hash].js",
| assetFileNames: "[ext]/name-[hash].[ext]",
| },
| },
| },
| });
|
|