-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
72 lines (71 loc) · 1.81 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
import { URL, fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue({
// Turns of Add-to-Calendar plugin console warnings
template: {
compilerOptions: {
// treat Add-to-Calendar-Button plugin like a custom element
isCustomElement: tag =>
tag.startsWith('add-'),
},
},
}),
svgLoader({ svgo: false })
],
build: {
lib: {
entry: resolve(__dirname, 'src/entry.js'),
name: 'ucla-library-website-components',
},
rollupOptions: {
external: ['vue', 'vue-router', 'pinia', 'vuetify'],
output: {
// preserveModules: true,
exports: 'named',
globals: {
vue: 'Vue',
},
},
},
},
css: {
preprocessorOptions: {
// Additional Sass options go here
scss: {
additionalData: `
@import "ucla-library-design-tokens/scss/fonts.scss";
@import "ucla-library-design-tokens/scss/_tokens-ftva";
@import "ucla-library-design-tokens/scss/app.scss";
`,
},
postcss: {
postcssOptions: {
plugins: [
[
'postcss-base64',
{
extensions: ['.svg'],
},
],
],
},
},
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~ucla-library-design-tokens': resolve(
__dirname,
'node_modules/ucla-library-design-tokens'
),
},
extensions: ['.mjs', '.mts', '.ts', '.jsx', '.tsx', '.vue', '.js', '.json'],
},
})