mirror of
https://github.com/quartz-community/og-image.git
synced 2026-07-22 02:50:23 +00:00
fix: exclude native sharp from bundling
This commit is contained in:
parent
f23ca9e8a7
commit
eb9701b77a
3 changed files with 7742 additions and 13932 deletions
21654
dist/index.js
vendored
21654
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue