-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
69 lines (65 loc) · 1.72 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
67
68
69
import path from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from 'vite-plugin-pwa';
import { visualizer } from 'rollup-plugin-visualizer';
import AutoImport from 'unplugin-auto-import/vite';
import svgLoader from 'vite-svg-loader';
import autoprefixer from 'autoprefixer';
import manifest from './vite/pwa/manifest';
export default defineConfig({
clearScreen: false,
server: {
port: 8080,
},
plugins: [
vue(),
VitePWA({ manifest }),
visualizer({
filename: path.resolve(__dirname, '.report/treemap.html'),
title: 'Bundle Visualizer – Treemap',
gzipSize: true,
brotliSize: true,
template: 'treemap',
}),
AutoImport({
dts: path.join(__dirname, 'auto-imports.d.ts'),
imports: ['vue', 'vue-router', '@vueuse/core'],
}),
svgLoader({
defaultImport: 'raw',
svgoConfig: {
plugins: [
{ name: 'removeTitle' },
{ name: 'removeViewBox' },
{ name: 'convertShapeToPath' },
{ name: 'removeAttrs', params: { attrs: ['data-name'] } },
{ name: 'inlineStyles', params: { onlyMatchedOnce: false } },
],
},
}),
],
root: 'src',
publicDir: path.resolve(__dirname, 'public'),
build: {
outDir: path.resolve(__dirname, 'dist'),
chunkSizeWarningLimit: 750,
sourcemap: true,
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
css: {
preprocessorOptions: {
stylus: {
// import these files so that they are available everywhere
imports: [path.resolve(__dirname, 'src/styles/variables.styl')],
},
},
postcss: {
plugins: [autoprefixer()],
},
},
});