-
Notifications
You must be signed in to change notification settings - Fork 16
/
vite.config.mjs
60 lines (58 loc) · 1.32 KB
/
vite.config.mjs
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
import vue from '@vitejs/plugin-vue'
import { createHtmlPlugin } from 'vite-plugin-html'
import { defineConfig } from 'vite'
import { resolve } from 'path'
export default defineConfig({
publicDir: 'public-vite',
plugins: [
vue(),
createHtmlPlugin({
minify: true,
inject: {
data: {
title: 'vue-modal playground',
description: 'Playground for vue-modal Vue.js 3'
}
}
})
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'@playground': resolve(__dirname, './playground'),
'@root': resolve(__dirname, './'),
'~bootstrap': 'bootstrap'
}
},
rollupInputOptions: {
input: resolve(__dirname, '/playground/main.js') // custom main
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "./playground/scss/variables";`
}
}
},
build: {
lib: {
entry: resolve(__dirname, 'src/index.js'),
name: 'VueModal',
fileName: (format) => `vue-modal.${format}.js`
},
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue'
},
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') {
return 'vue-modal.css'
}
return assetInfo.name
}
}
}
}
})