diff --git a/package.json b/package.json index cc683a127..593d1054a 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "start": "npx turbo watch build", "dev": "npx turbo watch dev", "build": "npx turbo build", + "build:fast": "FAST_BUILD=1 npx turbo build", "test": "npx turbo test", "test:watch": "npx turbo watch test", "check-types": "npx turbo check-types", diff --git a/packages/rivetkit/turbo.json b/packages/rivetkit/turbo.json index a10e0f4b9..91dcaed4e 100644 --- a/packages/rivetkit/turbo.json +++ b/packages/rivetkit/turbo.json @@ -14,7 +14,8 @@ "build": { "dependsOn": ["^build", "dump-openapi", "build:schema"], "inputs": ["src/**", "tsconfig.json", "tsup.config.ts", "package.json"], - "outputs": ["dist/**"] + "outputs": ["dist/**"], + "env": ["FAST_BUILD"] }, "test": { "dependsOn": ["^test", "build"], diff --git a/tsup.base.ts b/tsup.base.ts index 93cf64444..157dfec20 100644 --- a/tsup.base.ts +++ b/tsup.base.ts @@ -1,17 +1,22 @@ import type { Options } from "tsup"; +const FAST_BUILD = process.env.FAST_BUILD === "1"; + export default { target: "node16", platform: "node", format: ["cjs", "esm"], sourcemap: true, clean: true, - dts: { - compilerOptions: { - skipLibCheck: true, - resolveJsonModule: true, - }, - }, + // DTS takes the longest time, so we skip it if doing a fast build + dts: FAST_BUILD + ? false + : { + compilerOptions: { + skipLibCheck: true, + resolveJsonModule: true, + }, + }, minify: false, // IMPORTANT: Splitting is required to fix a bug with ESM (https://github.com/egoist/tsup/issues/992#issuecomment-1763540165) splitting: true, diff --git a/turbo.json b/turbo.json index 2de757ff8..a0ac36722 100644 --- a/turbo.json +++ b/turbo.json @@ -7,7 +7,8 @@ "build": { "dependsOn": ["^build"], "inputs": ["src/**", "tsconfig.json", "tsup.config.ts", "package.json"], - "outputs": ["dist/**"] + "outputs": ["dist/**"], + "env": ["FAST_BUILD"] }, "check-types": { "inputs": [