mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
refactor: remove cjs from build to reduce package size
This commit is contained in:
18
app/build.ts
18
app/build.ts
@@ -22,9 +22,11 @@ function buildTypes() {
|
|||||||
types_running = true;
|
types_running = true;
|
||||||
|
|
||||||
Bun.spawn(["bun", "build:types"], {
|
Bun.spawn(["bun", "build:types"], {
|
||||||
|
stdout: "inherit",
|
||||||
onExit: () => {
|
onExit: () => {
|
||||||
console.log("Types built");
|
console.log("Types built");
|
||||||
Bun.spawn(["bun", "tsc-alias"], {
|
Bun.spawn(["bun", "tsc-alias"], {
|
||||||
|
stdout: "inherit",
|
||||||
onExit: () => {
|
onExit: () => {
|
||||||
console.log("Types aliased");
|
console.log("Types aliased");
|
||||||
types_running = false;
|
types_running = false;
|
||||||
@@ -120,7 +122,7 @@ await tsup.build({
|
|||||||
external: ["bun:test", "@libsql/client"],
|
external: ["bun:test", "@libsql/client"],
|
||||||
metafile: true,
|
metafile: true,
|
||||||
platform: "browser",
|
platform: "browser",
|
||||||
format: ["esm", "cjs"],
|
format: ["esm"],
|
||||||
splitting: false,
|
splitting: false,
|
||||||
treeshake: true,
|
treeshake: true,
|
||||||
loader: {
|
loader: {
|
||||||
@@ -143,7 +145,7 @@ await tsup.build({
|
|||||||
external: ["bun:test", "react", "react-dom", "use-sync-external-store"],
|
external: ["bun:test", "react", "react-dom", "use-sync-external-store"],
|
||||||
metafile: true,
|
metafile: true,
|
||||||
platform: "browser",
|
platform: "browser",
|
||||||
format: ["esm", "cjs"],
|
format: ["esm"],
|
||||||
splitting: true,
|
splitting: true,
|
||||||
treeshake: true,
|
treeshake: true,
|
||||||
loader: {
|
loader: {
|
||||||
@@ -199,13 +201,11 @@ await tsup.build({
|
|||||||
|
|
||||||
await tsup.build({
|
await tsup.build({
|
||||||
...baseConfig("nextjs"),
|
...baseConfig("nextjs"),
|
||||||
format: ["esm", "cjs"],
|
|
||||||
platform: "node"
|
platform: "node"
|
||||||
});
|
});
|
||||||
|
|
||||||
await tsup.build({
|
await tsup.build({
|
||||||
...baseConfig("remix"),
|
...baseConfig("remix")
|
||||||
format: ["esm", "cjs"]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await tsup.build({
|
await tsup.build({
|
||||||
@@ -214,11 +214,9 @@ await tsup.build({
|
|||||||
|
|
||||||
await tsup.build({
|
await tsup.build({
|
||||||
...baseConfig("node"),
|
...baseConfig("node"),
|
||||||
platform: "node",
|
platform: "node"
|
||||||
format: ["esm", "cjs"]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await tsup.build({
|
await tsup.build({
|
||||||
...baseConfig("astro"),
|
...baseConfig("astro")
|
||||||
format: ["esm", "cjs"]
|
});
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user