-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathvite.config.js
64 lines (63 loc) · 1.54 KB
/
vite.config.js
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
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import { defineConfig } from 'vite'
import { createHtmlPlugin } from 'vite-plugin-html'
export default defineConfig({
publicDir: 'public-vite',
plugins: [
vue(),
createHtmlPlugin({
minify: true,
inject: {
data: {
title: 'vue-dataset playground',
description: 'Playground for vue-dataset 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: 'VueDataset',
fileName: (format) => `vue-dataset.${format}.js`,
},
rollupOptions: {
external: ['vue'],
output: {
globals: {
vue: 'Vue',
},
},
},
},
test: {
globals: true,
// Clear the mocks call count before each test so that we don't have to call vi.clearAllMocks manually - https://vitest.dev/config/#clearmocks
clearMocks: true,
environment: 'jsdom',
reporters: ['default'],
coverage: {
reporter: ['text', ['json-summary', { file: 'coverage-summary.json' }]],
include: ['src/**'],
},
},
})