@reasonabletech/config-tsup
v0.1.2
Published
Shared tsup configuration for ReasonableTech packages
Downloads
176
Maintainers
Readme
@reasonabletech/config-tsup
@reasonabletech/config-tsup provides shared tsup configuration factories for library and tooling packages. The defaults produce ESM-only output with declaration files, targeting a neutral platform — override only the options that differ from those defaults.
Installation
pnpm add -D @reasonabletech/config-tsup tsup typescriptPeer Dependencies
| Dependency | Version | Required | | ---------- | --------- | -------- | | tsup | >= 8.0 | Yes | | typescript | >= 5.0 | Yes |
This package generates tsup configuration objects and requires tsup 8.0+ for ESM-first defaults and TypeScript 5.0+ for type checking.
Exported API
import {
createTsupConfig,
configPackageConfig,
nodeConfig,
reactConfig,
type EsbuildOptionsFunction,
type TsupConfigOptions,
} from "@reasonabletech/config-tsup";Usage
Default Library Configuration
// tsup.config.ts
import { createTsupConfig } from "@reasonabletech/config-tsup";
export default createTsupConfig();Customized Configuration
// tsup.config.ts
import { createTsupConfig } from "@reasonabletech/config-tsup";
export default createTsupConfig({
dts: true,
entry: { index: "src/index.ts" },
external: ["react"],
});Preset Configurations
import {
configPackageConfig,
nodeConfig,
reactConfig,
} from "@reasonabletech/config-tsup";
export default reactConfig;Defaults
createTsupConfig() defaults to:
entry: { index: "src/index.ts" }format: ["esm"]platform: "neutral"target: "ES2023"sourcemap: truetreeshake: truesplitting: falseclean: false
If tsconfig is omitted, the factory uses tsconfig.build.json automatically when present.
Changelog
See CHANGELOG.md for release history.
This package follows Semantic Versioning. Breaking changes are documented with migration guides when applicable.
