-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
53 lines (52 loc) · 1.22 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
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import eslintPlugin from "vite-plugin-eslint";
import vuefrontPlugin from "vite-plugin-vue-vuefront";
import voie from "vite-plugin-voie";
import viteGraphlQl from "vite2-graphql-plugin";
import path from "path";
import { visualizer } from "rollup-plugin-visualizer";
import { optimizeLodashImports } from "@optimize-lodash/rollup-plugin";
export const ssrTransformCustomDir = () => {
return {
props: [],
needRuntime: true,
};
};
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const plugins = [];
if (mode === "production") {
plugins.push(optimizeLodashImports());
plugins.push(visualizer());
}
return {
optimizeDeps: {
include: ["lodash"],
},
resolve: {
alias: {
"~": path.resolve(__dirname, "./src"),
},
},
plugins: [
vue({
template: {
ssr: true,
compilerOptions: {
directiveTransforms: {
lazy: ssrTransformCustomDir,
},
},
},
}),
viteGraphlQl(),
voie(),
eslintPlugin({
fix: true,
}),
vuefrontPlugin(),
...plugins,
],
};
});