You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/how-it-works.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ When you publish a library, your consumers install its `dependencies`, `peerDepe
38
38
|[`deps.onlyBundle`](../options/dependencies.md#deps-onlybundle)| Whitelist of dependencies allowed to be bundled. Any unlisted dependency that ends up in the bundle causes an error. Useful for catching accidental inlining in large projects. |
39
39
|[`deps.neverBundle`](../options/dependencies.md#deps-neverbundle)| Explicitly mark additional packages as external (never bundled), or `true` to externalize all dependencies. |
40
40
|[`deps.alwaysBundle`](../options/dependencies.md#deps-alwaysbundle)| Force specific packages to be bundled, even if they're in `dependencies`. |
41
-
|[`deps.resolveDepSubpath`](../options/dependencies.md#deps-resolvedepsubpath)|Resolve external dependency subpath imports to their actual package-relative paths.|
41
+
|[`deps.resolveDepSubpath`](../options/dependencies.md#deps-resolvedepsubpath)|Optionally resolve external dependency subpath imports to their actual package-relative paths. |
42
42
43
43
See [Dependencies](../options/dependencies.md) for details.
Copy file name to clipboardExpand all lines: docs/options/dependencies.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ export default defineConfig({
32
32
alwaysBundle: ['some-package'],
33
33
onlyBundle: ['cac', 'bumpp'],
34
34
onlyImport: ['cac'],
35
-
resolveDepSubpath: false,
35
+
resolveDepSubpath: true,
36
36
},
37
37
})
38
38
```
@@ -45,21 +45,21 @@ export default defineConfig({
45
45
46
46
### `deps.resolveDepSubpath`
47
47
48
-
When an external dependency has no `exports` field, tsdown resolves subpath imports to their actual package-relative paths by default. For example, `my-dep/functions/lt` may become `my-dep/functions/lt.js`, and `my-dep/folder` may become `my-dep/folder/index.js`.
48
+
By default, tsdown preserves external dependency subpath imports as written. Enable `resolveDepSubpath` to resolve subpath imports to their actual package-relative paths when a package has no `exports` field. For example, `my-dep/functions/lt` may become `my-dep/functions/lt.js`, and `my-dep/folder` may become `my-dep/folder/index.js`.
49
49
50
-
Set `resolveDepSubpath` to `false` to preserve the original import specifier:
50
+
Set `resolveDepSubpath` to `true` to enable this behavior:
51
51
52
52
```ts [tsdown.config.ts]
53
53
import { defineConfig } from'tsdown'
54
54
55
55
exportdefaultdefineConfig({
56
56
deps: {
57
-
resolveDepSubpath: false,
57
+
resolveDepSubpath: true,
58
58
},
59
59
})
60
60
```
61
61
62
-
The default value is `true`.
62
+
The default value is `false`.
63
63
64
64
### `deps.onlyBundle`
65
65
@@ -220,7 +220,7 @@ The following top-level options are deprecated. Please migrate to the `deps` nam
220
220
- Use `deps.onlyImport` to whitelist packages the output is allowed to import at runtime.
221
221
- Use `deps.neverBundle` to mark specific dependencies as external, or set it to `true` to externalize all dependencies.
222
222
- Use `deps.alwaysBundle` to force specific dependencies to be bundled.
223
-
-Set`deps.resolveDepSubpath` to `false` to preserve external dependency subpath imports as written.
223
+
-Enable`deps.resolveDepSubpath` to resolve external dependency subpath imports to their package-relative paths.
224
224
-**Declaration Files**:
225
225
- The bundling logic for declaration files is now the same as for JavaScript.
226
226
- Use `resolver: 'tsc'` for better compatibility with complex third-party types.
0 commit comments