-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
59 lines (55 loc) · 1.48 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
/// <reference types="vitest" />
import { defineConfig, PluginOption } from "vite"
import path from "path"
import react from "@vitejs/plugin-react-swc"
import { visualizer } from "rollup-plugin-visualizer"
import { checker } from "vite-plugin-checker"
import { VitePWA as pwa, ManifestOptions } from "vite-plugin-pwa"
import styleLint from "vite-plugin-stylelint"
import reactSVG from "vite-plugin-svgr"
import tsconfigPaths from "vite-tsconfig-paths"
import { default as manifest } from "./manifest.json"
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
["styles"]: path.resolve(__dirname, "src", "styles"),
},
},
test: {
environment: "jsdom",
coverage: {
reporter: ["text", "html"],
},
},
server: {
host: true,
},
css: {
preprocessorOptions: {
scss: { quietDeps: true },
},
},
plugins: [
tsconfigPaths(),
checker({
eslint: !process.env.VITEST && { lintCommand: 'eslint "src/**/*.{ts,tsx,js,jsx}"' },
typescript: true,
}),
styleLint({
fix: !process.env.VITEST,
cache: false,
}),
pwa({
devOptions: { enabled: false },
includeAssets: ["vite.svg"],
manifestFilename: "manifest.json",
manifest: manifest as Partial<ManifestOptions>,
registerType: "autoUpdate",
workbox: { globPatterns: ["**/*.{js,css,html}", "**/*.{svg,png,jpg,gif}"] },
}),
react(),
reactSVG(),
visualizer({ open: true }) as PluginOption,
],
})