-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.mts
More file actions
52 lines (51 loc) · 1.15 KB
/
vite.config.mts
File metadata and controls
52 lines (51 loc) · 1.15 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
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import svgrPlugin from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import dts from 'vite-plugin-dts';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
export default defineConfig({
build: {
lib: {
entry: 'src/index.ts',
fileName: format => `modelling.${format}.js`,
formats: ['es', 'cjs'],
},
rollupOptions: {
external: ['react', 'react/jsx-runtime', 'react-dom', /@leafygreen-ui\/*/, '@emotion/react'],
},
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
},
resolve: {
alias: {
'@': 'src',
},
},
plugins: [
react(),
cssInjectedByJsPlugin(),
dts({
rollupTypes: true,
}),
svgrPlugin(),
nodePolyfills(),
tsconfigPaths(),
],
test: {
server: {
deps: {
inline: [/xyflow/]
}
},
include: ['**/*.test.{ts,tsx}'],
environment: 'jsdom',
globals: true,
setupFiles: ['./test-setup.ts'],
},
});