This repository was archived by the owner on Nov 30, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (53 loc) · 1.14 KB
/
vite.config.ts
File metadata and controls
55 lines (53 loc) · 1.14 KB
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
/// <reference types="vitest" />
import * as path from 'path'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
export default defineConfig({
plugins: [
dts({
include: 'src/**',
outputDir: 'dist/types',
staticImport: true,
}),
],
build: {
lib: {
entry: path.resolve(__dirname, 'src/main.ts'),
formats: ['es', 'umd'],
name: 'd3-graph-controller',
fileName: (format) => `d3-graph-controller.${format}.js`,
},
rollupOptions: {
external: ['d3-drag', 'd3-force', 'd3-selection', 'd3-zoom', 'vecti'],
output: {
globals: {
'd3-drag': 'd3',
'd3-force': 'd3',
'd3-selection': 'd3',
'd3-zoom': 'd3',
vecti: 'vecti',
},
},
},
},
resolve: {
alias: [
{
find: 'src',
replacement: path.resolve(__dirname, 'src'),
},
{
find: 'test',
replacement: path.resolve(__dirname, 'test'),
},
],
},
test: {
include: ['test/**/*.test.ts'],
environment: 'jsdom',
coverage: {
all: true,
include: ['src/**/*.ts'],
},
},
})