rolldown-plugin-dts 0.21.3 → 0.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -110,7 +110,8 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
110
110
|
const file = parse(code, {
|
|
111
111
|
plugins: [["typescript", { dts: true }]],
|
|
112
112
|
sourceType: "module",
|
|
113
|
-
errorRecovery: true
|
|
113
|
+
errorRecovery: true,
|
|
114
|
+
createParenthesizedExpressions: true
|
|
114
115
|
});
|
|
115
116
|
const { program, comments } = file;
|
|
116
117
|
const typeOnlyIds = [];
|
|
@@ -1033,7 +1034,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
1033
1034
|
async function resolveDtsPath(id, importer, rolldownResolution) {
|
|
1034
1035
|
let dtsPath;
|
|
1035
1036
|
if (resolver === "tsc") {
|
|
1036
|
-
const { tscResolve } = await import("./resolver-
|
|
1037
|
+
const { tscResolve } = await import("./resolver-CQnlAxJ7.mjs");
|
|
1037
1038
|
dtsPath = tscResolve(id, importer, cwd, tsconfig, tsconfigRaw);
|
|
1038
1039
|
} else dtsPath = baseDtsResolver(id, importer);
|
|
1039
1040
|
debug$1("Using %s for dts import: %O -> %O", resolver, id, dtsPath);
|
|
@@ -8,7 +8,10 @@ const debug = createDebug("rolldown-plugin-dts:tsc-resolver");
|
|
|
8
8
|
function tscResolve(id, importer, cwd, tsconfig, tsconfigRaw, reference) {
|
|
9
9
|
const baseDir = tsconfig ? path.dirname(tsconfig) : cwd;
|
|
10
10
|
const parsedConfig = ts.parseJsonConfigFileContent(tsconfigRaw, ts.sys, baseDir);
|
|
11
|
-
const resolved = ts.bundlerModuleNameResolver(id, importer,
|
|
11
|
+
const resolved = ts.bundlerModuleNameResolver(id, importer, {
|
|
12
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
13
|
+
...parsedConfig.options
|
|
14
|
+
}, ts.sys, void 0, reference);
|
|
12
15
|
debug(`tsc resolving id "%s" from "%s" -> %O`, id, importer, resolved.resolvedModule);
|
|
13
16
|
return resolved.resolvedModule?.resolvedFileName;
|
|
14
17
|
}
|