-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: improve tsup config for turbo (#3293)
- Loading branch information
Showing
25 changed files
with
218 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts", "src/abi-ts.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: { | ||
index: "src/exports/index.ts", | ||
internal: "src/exports/internal.ts", | ||
"deprecated/node": "src/deprecated/node/index.ts", | ||
}, | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/cli.ts"], | ||
minify: true, | ||
sourcemap: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
tsconfig: "tsconfig.tsup.json", | ||
entry: ["src/bin/explorer.ts", "src/exports/observer.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: false, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts", "bin/faucet-server.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["ts/index.ts", "ts/gas-report.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: { | ||
index: "src/exports/index.ts", | ||
internal: "src/exports/internal.ts", | ||
}, | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts", "src/deprecated/index.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts"], | ||
target: "esnext", | ||
format: ["cjs"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: ["src/index.ts"], | ||
target: "esnext", | ||
format: ["cjs"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import { defineConfig } from "tsup"; | ||
|
||
export default defineConfig({ | ||
export default defineConfig((opts) => ({ | ||
entry: { | ||
index: "src/exports/index.ts", | ||
internal: "src/exports/internal.ts", | ||
}, | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: !process.env.TSUP_SKIP_DTS, | ||
sourcemap: true, | ||
clean: true, | ||
minify: true, | ||
}); | ||
// don't generate DTS during watch mode because it's slow | ||
// we're likely using TS source in this mode anyway | ||
dts: !opts.watch, | ||
// don't clean during watch mode to avoid removing | ||
// previously-built DTS files, which other build tasks | ||
// depend on | ||
clean: !opts.watch, | ||
})); |
Oops, something went wrong.