-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.test.ts
47 lines (46 loc) · 1.25 KB
/
vite.test.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
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react';
import path from 'node:path';
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { peerDependencies } from './package.json';
export default defineConfig({
plugins: [
vanillaExtractPlugin(),
react({
jsxRuntime: 'classic',
}),
dts({
outputDir: path.resolve(__dirname, 'dist/types'),
exclude: ['**/stories/**'],
entryRoot: path.resolve(__dirname, 'src/index.ts'),
afterDiagnostic: console.debug,
skipDiagnostics: false,
copyDtsFiles: true,
}),
visualizer({
emitFile: true,
}),
],
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'UI',
formats: ['es', 'umd'],
fileName: format => `@sa-ui.${format}.js`,
},
rollupOptions: {
external: [...Object.keys(peerDependencies)],
output: {
globals: {
'@react-spring/web': 'SpringWeb',
'@vanilla-extract/css': 'VanillaCss',
'@vanilla-extract/recipes': 'VanillaRecipes',
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
},
});