fix: exclude native sharp from bundling

This commit is contained in:
saberzero1 2026-04-27 22:20:12 +02:00
parent f23ca9e8a7
commit eb9701b77a
No known key found for this signature in database
3 changed files with 7742 additions and 13932 deletions

21654
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -1,18 +1,6 @@
import { defineConfig } from "tsup";
import type { BuildOptions } from "esbuild";
const SINGLETON_EXTERNALS = [
"preact",
"preact/hooks",
"preact/jsx-runtime",
"preact/compat",
"@jackyzha0/quartz",
"@jackyzha0/quartz/*",
"vfile",
"vfile/*",
"unified",
];
export default defineConfig({
entry: {
index: "src/index.ts",
@ -24,13 +12,9 @@ export default defineConfig({
treeshake: true,
target: "es2022",
splitting: false,
noExternal: [/.*/],
noExternal: ["@quartz-community/types", "@quartz-community/utils"],
outDir: "dist",
platform: "node",
external: SINGLETON_EXTERNALS,
banner: {
js: 'import { createRequire } from "module"; const require = createRequire(import.meta.url);',
},
esbuildOptions(options: BuildOptions) {
options.jsx = "automatic";
options.jsxImportSource = "preact";