0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/elements/tsup.config.ts

27 lines
625 B
TypeScript
Raw Permalink Normal View History

2024-07-18 21:42:03 -05:00
import fs from 'node:fs/promises';
2024-07-14 22:43:48 -05:00
import { defineConfig } from 'tsup';
export default defineConfig({
entry: {
'account/index': 'src/account/index.ts',
'account/react': 'src/account/react.ts',
},
2024-07-14 22:43:48 -05:00
format: 'esm',
dts: true,
clean: true,
2024-07-18 21:42:03 -05:00
esbuildPlugins: [
{
name: 'transform-svg',
setup: (build) => {
build.onLoad({ filter: /\.svg$/ }, async (arguments_) => {
const text = await fs.readFile(arguments_.path, 'utf8');
return {
contents: `import { html } from 'lit';\nexport default html\`${text}\`;`,
};
});
},
},
],
2024-07-14 22:43:48 -05:00
});