mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
24 lines
562 B
TypeScript
24 lines
562 B
TypeScript
|
import fs from 'node:fs/promises';
|
||
|
|
||
|
import { defineConfig } from 'tsup';
|
||
|
|
||
|
export default defineConfig({
|
||
|
entry: ['src/index.ts', 'src/react.ts'],
|
||
|
format: 'esm',
|
||
|
dts: true,
|
||
|
clean: true,
|
||
|
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}\`;`,
|
||
|
};
|
||
|
});
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
});
|