|
1 | | -import { resolve } from 'path' |
2 | | -import { defineConfig } from 'vite' |
3 | | -import react from '@vitejs/plugin-react-swc' |
| 1 | +import { resolve } from "path" |
| 2 | +import { defineConfig } from "vite" |
| 3 | +import react from "@vitejs/plugin-react-swc" |
4 | 4 | import svgr from "vite-plugin-svgr" |
5 | 5 | import paths from "vite-tsconfig-paths" |
6 | 6 |
|
7 | | - |
8 | 7 | export default defineConfig({ |
9 | 8 | plugins: [paths(), react(), svgr()], |
10 | 9 | build: { |
11 | 10 | lib: { |
12 | | - entry: resolve(__dirname, 'src/index.ts'), |
13 | | - name: 'TailscaleUiComponents', |
14 | | - fileName: 'tailscale-ui-components', |
| 11 | + entry: resolve(__dirname, "src/index.ts"), |
| 12 | + name: "TailscaleUiComponents", |
| 13 | + formats: ["es", "umd"], |
| 14 | + fileName: (format) => `tailscale-ui-components.${format}.js`, |
15 | 15 | }, |
16 | 16 | rollupOptions: { |
17 | | - external: ['react', 'react-dom', 'tailwindcss'], |
| 17 | + external: ["react", "react-dom"], |
18 | 18 | output: { |
19 | 19 | globals: { |
20 | | - react: 'React', |
21 | | - 'react-dom': 'ReactDOM', |
22 | | - tailwindcss: 'tailwindcss', |
| 20 | + react: "React", |
| 21 | + "react-dom": "ReactDOM", |
23 | 22 | }, |
24 | 23 | }, |
25 | 24 | }, |
|
0 commit comments