-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
119 lines (113 loc) · 2.9 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
import dts from "vite-plugin-dts"
import glob from "glob"
export default defineConfig({
resolve: {
conditions: ["import", "browser", "module", "default"],
extensions: [".js", ".ts", ".vue", ".json"]
},
json: {
namedExports: false,
stringify: true
},
//esbuild: { include: ['js', 'ts'] },
build: {
minify: false,
outDir: "./dist",
emptyOutDir: true,
lib: {
entry: "projects/vue3/index.ts",
name: "vue3",
fileName: "[name]",
//formats: ["es", "cjs", "umd", "iife"]
//formats: ["es", "umd"]
formats: ["es"]
//formats: ["es", "cjs"]
},
rollupOptions: {
external: [
"vue",
"vue-oidc-client",
"pinia",
"@heroicons",
],
//input: glob.sync("./projects/vue3/**/index.ts"),
// input: {
// //auth: path.resolve(__dirname, 'lib/auth/index.ts'),
// components: path.resolve(__dirname, 'lib/components/index.ts')
// },
output: {
//preserveModules: true,
//sourcemap: "inline",
globals: {
"vue": "Vue",
"vue-oidc-client": "vue-oidc-client",
"pinia": "pinia",
"@heroicons": "@heroicons"
}
},
// output: [
// {
// sourcemap: "inline",
// globals: {
// vue: "Vue"
// },
// entryFileNames: ({ facadeModuleId }) => facadeModuleId.includes('components') ? 'components.esm.js' : 'components2.esm.js',
// format: 'esm',
// dir: path.resolve(__dirname, 'lib/components')
// },
// // {
// // entryFileNames: ({ facadeModuleId }) => facadeModuleId.includes('auth') ? 'auth.cmj.js' : 'auth2.cmj.js',
// // format: 'commonjs',
// // exports: 'named',
// // dir: path.resolve(__dirname, 'lib/auth')
// // },
// ],
// plugins: [
// buble()
// ]
}
},
plugins: [
vue(),
dts({
//outputDir: './dist/',
//root: 'x',
staticImport: true,
insertTypesEntry: true,
cleanVueFileName: true,
clearPureImport: true
})
]
})
// // https://vitejs.dev/config/
// export default defineConfig({
// plugins: [
// vue()
// ],
// build: {
// lib: {
// entry: path.resolve(__dirname, 'lib/main.ts'),
// name: '@uvicore/vue3'
// },
// rollupOptions: {
// // make sure to externalize deps that shouldn't be bundled
// // into your library
// external: ['vue'],
// output: {
// // Provide global variables to use in the UMD build
// // for externalized deps
// globals: {
// vue: 'Vue'
// }
// },
// plugins: [
// typescript2({
// tsconfig: "tsconfig.json",
// }),
// ]
// }
// }
// })