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