mirror of
https://github.com/quartz-community/og-image.git
synced 2026-07-22 02:50:23 +00:00
39 lines
803 B
TypeScript
39 lines
803 B
TypeScript
import { defineConfig } from "tsup";
|
|
import type { BuildOptions } from "esbuild";
|
|
|
|
const EXTERNALS = [
|
|
"preact",
|
|
"preact/hooks",
|
|
"preact/jsx-runtime",
|
|
"preact/compat",
|
|
"@jackyzha0/quartz",
|
|
"@jackyzha0/quartz/*",
|
|
"vfile",
|
|
"vfile/*",
|
|
"unified",
|
|
"sharp",
|
|
];
|
|
|
|
export default defineConfig({
|
|
entry: {
|
|
index: "src/index.ts",
|
|
},
|
|
format: ["esm"],
|
|
dts: true,
|
|
sourcemap: true,
|
|
clean: true,
|
|
treeshake: true,
|
|
target: "es2022",
|
|
splitting: false,
|
|
noExternal: [/^(?!sharp)/],
|
|
external: EXTERNALS,
|
|
outDir: "dist",
|
|
platform: "node",
|
|
banner: {
|
|
js: 'import { createRequire } from "module"; const require = createRequire(import.meta.url);',
|
|
},
|
|
esbuildOptions(options: BuildOptions) {
|
|
options.jsx = "automatic";
|
|
options.jsxImportSource = "preact";
|
|
},
|
|
});
|