-
Notifications
You must be signed in to change notification settings - Fork 72
/
tsup.config.ts
27 lines (26 loc) · 760 Bytes
/
tsup.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { defineConfig } from "tsup";
import { RawPlugin } from "./build/raw";
import plugin from "node-stdlib-browser/helpers/esbuild/plugin";
import stdLibBrowser from "node-stdlib-browser";
export default defineConfig({
entry: ["src/index.ts", "src/mdx.ts", "src/server.ts", "src/client.ts"],
splitting: false,
sourcemap: true,
clean: false,
format: ["cjs", "esm"],
platform: "browser",
dts: true,
esbuildOptions: (options) => {
options.inject = ["node-stdlib-browser/helpers/esbuild/shim"];
options.define = {
url: "url",
tty: "tty",
fs: "fs",
path: "path",
process: "process",
};
},
esbuildPlugins: [RawPlugin(), plugin(stdLibBrowser)],
external: ["react", "react-dom"],
bundle: true,
});