-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.ts
49 lines (48 loc) · 1.11 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
import { join, resolve } from 'node:path';
import vue from '@vitejs/plugin-vue';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
root: __dirname,
plugins: [
vue(),
dts({
outputDir: join(__dirname, 'build'),
tsConfigFilePath: join(__dirname, 'tsconfig.json'),
skipDiagnostics: false,
logDiagnostics: true,
staticImport: true,
}),
],
resolve: {
alias: [{ find: /^@\/(.*)/, replacement: `${resolve(__dirname, 'src')}/$1` }],
},
json: {
namedExports: false,
stringify: true,
},
build: {
sourcemap: process.env.MODE === 'development' ? true : false,
outDir: 'build',
assetsDir: '.',
minify: process.env.MODE === 'development' ? false : 'terser',
target: 'chrome104',
terserOptions: {
ecma: 2020,
compress: {
passes: 2,
},
safari10: false,
},
lib: {
entry: join('src', 'index.ts'),
fileName: 'index',
name: 'Form',
formats: ['es', 'cjs'],
},
rollupOptions: {
external: ['vue'],
},
emptyOutDir: true,
},
});