-
Notifications
You must be signed in to change notification settings - Fork 134
/
vite.config.js
52 lines (49 loc) · 1.62 KB
/
vite.config.js
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
import {defineConfig} from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
const config = defineConfig({
plugins: [vue()],
target: 'es2015',
build: {
outDir: path.resolve(__dirname, './dist'),
lib: {
entry: path.resolve(__dirname, './src/index.js'),
name: 'ViewUIPlus'
},
rollupOptions: {
context: 'globalThis',
preserveEntrySignatures: 'strict',
external: ['vue'],
output: [
{
format: 'umd',
exports: 'named',
sourcemap: false,
entryFileNames: 'viewuiplus.min.js',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
namespaceToStringTag: true,
inlineDynamicImports: false,
manualChunks: undefined,
globals: { vue: 'Vue' }
},
{
format: 'es',
exports: 'named',
sourcemap: false,
entryFileNames: 'viewuiplus.min.esm.js',
chunkFileNames: '[name].js',
assetFileNames: '[name].[ext]',
namespaceToStringTag: true,
inlineDynamicImports: false,
manualChunks: undefined,
globals: { vue: 'Vue' }
}
]
}
},
resolve: {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
}
});
export default config;