twenty/front/tsup.config.js

27 lines
639 B
JavaScript
Raw Normal View History

import { defineConfig } from "tsup";
2023-11-10 20:25:14 +03:00
import svgr from 'esbuild-plugin-svgr'
export default defineConfig([
{
entry: {"index": './tsup.ui.index.tsx'},
treeshake: true,
minify: true,
verbose: true,
dts: true,
clean: true,
outDir: "../docs/src/ui/generated",
2023-11-10 20:25:14 +03:00
esbuildPlugins: [svgr({ template })],
},
2023-11-10 20:25:14 +03:00
]);
function template(variables, { tpl }) {
return tpl`
${variables.imports};
${variables.interfaces};
const ${variables.componentName} = (${variables.props}) => (
${variables.jsx}
);
${variables.exports};
export const ReactComponent = ${variables.componentName};
`;
};