mirror of
https://github.com/egoist/tsup.git
synced 2025-12-08 20:35:58 +00:00
feat: externalize peerDependencies (#132)
This commit is contained in:
parent
298eb7c3ff
commit
c1983b878a
@ -44,7 +44,7 @@ Code splitting is enabled by default and supported in `cjs` and `esm` format.
|
||||
|
||||
### Excluding packages
|
||||
|
||||
By default tsup bundles all `import`-ed modules but `dependencies` in your `packages.json` are always excluded, you can also use `--external <module>` flag to mark other packages as external.
|
||||
By default tsup bundles all `import`-ed modules but `dependencies` and `peerDependencies` in your `packages.json` are always excluded, you can also use `--external <module>` flag to mark other packages as external.
|
||||
|
||||
### Generate declaration file
|
||||
|
||||
|
||||
@ -65,7 +65,10 @@ export function loadTsConfig(cwd: string) {
|
||||
export async function getDeps(cwd: string) {
|
||||
const data = await loadPkg(cwd)
|
||||
|
||||
const deps = Object.keys(data.dependencies || {})
|
||||
const deps = Array.from(new Set([
|
||||
...Object.keys(data.dependencies || {}),
|
||||
...Object.keys(data.peerDependencies || {})
|
||||
]))
|
||||
|
||||
return deps
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user