-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (52 loc) · 1.34 KB
/
Copy pathvite.config.ts
File metadata and controls
55 lines (52 loc) · 1.34 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
import react from '@vitejs/plugin-react';
import path from 'node:path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import svgr from 'vite-plugin-svgr';
import { dependencies, peerDependencies } from './package.json';
const externalPackages = [
...Object.keys(dependencies),
...Object.keys(peerDependencies),
];
export default defineConfig({
plugins: [
react(),
svgr(),
dts({
exclude: [
'.cursor/**',
'**/*.stories.tsx',
'**/*.spec.tsx',
'**/*.test.tsx',
],
aliasesExclude: ['react', 'react-dom', '@floating-ui/react'],
}),
],
resolve: {
dedupe: ['react', 'react-dom'],
alias: {
react: path.resolve(__dirname, './node_modules/react'),
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
'@floating-ui/react': path.resolve(
__dirname,
'./node_modules/@floating-ui/react',
),
'@': path.resolve(__dirname, './src'),
},
},
build: {
lib: {
entry: './src/index.ts',
name: 'aiDialReactFileManager',
fileName: 'ai-dial-react-file-manager.es',
formats: ['es'],
},
rollupOptions: {
external: (id) =>
externalPackages.some(
(packageName) =>
id === packageName || id.startsWith(`${packageName}/`),
),
},
},
});