-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
37 lines (36 loc) · 988 Bytes
/
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
// vite.config.js
import { resolve } from 'path'
import { defineConfig } from 'vite'
// import legacy from '@vitejs/plugin-legacy'
// import { babel } from '@rollup/plugin-babel';
export default defineConfig({
plugins: [
// legacy({
// targets: ['ie >= 11'],
// additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
// }),
// babel({
// babelHelpers: 'runtime',
// // babelHelpers: 'external',
// extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', 'ts'],
// })
],
build: {
lib: {
entry: resolve(__dirname, './u/index.js'),
name: 'u',
// the proper extensions will be added
fileName: 'u'
},
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
// external: ['vue'],
// output: {
// // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
// globals: {
// vue: 'Vue'
// }
// }
}
}
})