2024-04-17 19:06:02 +03:00
|
|
|
import { defineConfig } from 'tsup';
|
|
|
|
import svgr from 'esbuild-plugin-svgr';
|
|
|
|
import { Config } from '@svgr/core';
|
2023-11-10 20:25:14 +03:00
|
|
|
|
2024-04-17 19:06:02 +03:00
|
|
|
const template: Config['template'] = (variables, { tpl }) => {
|
2023-11-10 20:25:14 +03:00
|
|
|
return tpl`
|
|
|
|
${variables.imports};
|
|
|
|
${variables.interfaces};
|
|
|
|
const ${variables.componentName} = (${variables.props}) => (
|
|
|
|
${variables.jsx}
|
|
|
|
);
|
|
|
|
${variables.exports};
|
|
|
|
export const ReactComponent = ${variables.componentName};
|
|
|
|
`;
|
2024-04-17 19:06:02 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
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 })],
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
|
|
|
|
|