-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
48 lines (46 loc) · 1.08 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
/// <reference types="vitest" />
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
import { configDefaults } from 'vitest/config';
import dts from 'vite-plugin-dts';
const testDef = {
test: {
exclude: [...configDefaults.exclude, './build/**', './dist/**'],
coverage: {
reporter: ['text', 'html'],
extension: ['.ts'],
include: ['src'],
exclude: [
'src/contracts',
'src/types',
'src/vite-env.d.ts'
],
},
},
};
export default defineConfig({
base: './',
plugins: [
dts({
exclude: ['**/**.spec.**', '*.config.*'],
insertTypesEntry: true,
}),
],
define: {
PACKAGE_VERSION: JSON.stringify(process.env.npm_package_version),
},
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: fileURLToPath(new URL('src/index.ts', import.meta.url)),
name: 'nmscdCoordinateConversion',
formats: ['es', 'umd'],
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
...testDef,
});