-
Notifications
You must be signed in to change notification settings - Fork 14
/
vite.config.ts
65 lines (62 loc) · 1.58 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
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'node:path'
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
template: { transformAssetUrls },
}),
dts({
insertTypesEntry: true,
copyDtsFiles: true,
}),
// @quasar/plugin-vite options list:
// https://github.com/quasarframework/quasar/blob/dev/vite-plugin/index.d.ts
quasar({
sassVariables: 'src/styles/quasar.variables.scss',
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
lib: {
entry: resolve(__dirname, 'src/entry.ts'),
name: 'Vue3QTelInput',
fileName: 'vue3-q-tel-input',
formats: ['es', 'cjs', 'umd'],
},
sourcemap: false,
minify: 'terser',
terserOptions: {
compress: true,
mangle: true,
},
rollupOptions: {
onwarn: (warning, warn) => {
// There is a [bug](https://github.com/vuejs/babel-plugin-jsx/issues/697)
if (warning.code === 'UNUSED_EXTERNAL_IMPORT') {
return
}
warn(warning)
},
external: ['vue', 'quasar'],
strictDeprecations: true,
output: {
// Provide global variables to use in the UMD build
// for externalized deps
sourcemap: false,
globals: {
vue: 'Vue',
quasar: 'Quasar',
},
},
},
},
})