-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
57 lines (51 loc) · 1.11 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
/* global __dirname */
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { configDefaults } from 'vitest/config';
// import babel from 'vite-plugin-babel';
import banner from 'vite-plugin-banner';
import pkg from './package.json';
const bannerText = `/*!
* BirthdayPicker v${pkg.version}
* ${pkg.homepage}
*/`;
export default defineConfig({
build: {
target: 'es2015', // esnext
lib: {
entry: resolve(__dirname, 'src/index.js'),
name: 'BirthdayPicker',
fileName: (format) => {
format = 'es' === format ? '' : `.${format}`;
return `birthdaypicker${format}.js`;
},
},
},
test: {
globals: true,
environment: 'jsdom',
coverage: {
provider: 'v8', // 'istanbul' or 'v8'
exclude: [
...configDefaults.exclude,
'_notes/**',
'config/**',
'docs/**',
'test/*.bench.*',
'.eslintrc.js',
],
},
},
resolve: {
alias: [
{
find: '@',
replacement: resolve(__dirname, 'src'),
},
],
},
plugins: [
// babel(),
banner(bannerText),
],
});