-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
69 lines (64 loc) · 1.98 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 { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import vue from "@vitejs/plugin-vue";
import { resolve } from 'path';
import dts from 'vite-plugin-dts';
// import AutoImport from "unplugin-auto-import/vite";
// import Components from "unplugin-vue-components/vite";
// import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'describo-crate-builder-react',
fileName: 'describo-crate-builder-react',
},
minify: false,
rollupOptions: {
external: ['react', 'react-dom', 'styled-components'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'styled-components': 'styled',
},
},
},
},
// For Describo
plugins: [
react(),
vue(),
dts({
include:[
"src/index.ts",
"src/types.ts",
"src/Bridge.vue",
"src/DescriboCrateBuilder.tsx",
]
})
// AutoImport({
// resolvers: [ElementPlusResolver()],
// }),
// Components({
// resolvers: [ElementPlusResolver()],
// }),
],
optimizeDeps: {
include: [
"element-plus",
"lodash",
"@describo/crate-builder-component",
"ajv", // Supress: The requested module '/node_modules/ajv/dist/ajv.js?v=09173956' does not provide an export named 'default'
"dayjs", // Supress: SyntaxError: The requested module '/node_modules/dayjs/dayjs.min.js?v=26ae2de4' does not provide an export named 'default' (at Date.component.vue:21:8)
'validator' // Superss: SyntaxError: The requested module '/node_modules/validator/index.js?v=ae63bf27' does not provide an export named 'isURL' (at VM4514 lib.ts:7:10)
],
},
resolve: {
// Use that version of Vue, which supports compilation of inline (string) templates
alias: {
vue: 'vue/dist/vue.esm-bundler.js',
},
},
})