mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-30 20:27:55 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			690 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			690 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Config } from '@svgr/core';
 | |
| import svgr from 'esbuild-plugin-svgr';
 | |
| import { defineConfig } from 'tsup';
 | |
| 
 | |
| const template: Config['template'] = (variables, { tpl }) => {
 | |
|   return tpl`
 | |
|     ${variables.imports};
 | |
|     ${variables.interfaces};
 | |
|     const ${variables.componentName} = (${variables.props}) => (
 | |
|       ${variables.jsx}
 | |
|     ); 
 | |
|     ${variables.exports};
 | |
|     export const ReactComponent = ${variables.componentName};
 | |
|   `;
 | |
| };
 | |
| 
 | |
| export default defineConfig([
 | |
|   {
 | |
|     entry: { index: './tsup.ui.index.tsx' },
 | |
|     treeshake: true,
 | |
|     minify: true,
 | |
|     dts: true,
 | |
|     clean: true,
 | |
|     outDir: '../twenty-docs/src/ui/generated',
 | |
|     esbuildPlugins: [svgr({ template })],
 | |
|   },
 | |
| ]);
 | |
| 
 | |
| 
 | 
