rolldown-plugin-dts 0.8.4 → 0.8.5
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.js +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -727,7 +727,9 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclarations,
|
|
|
727
727
|
meta
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
|
-
|
|
730
|
+
const tsImporter = filename_dts_to(importer, "ts");
|
|
731
|
+
let resolution = await this.resolve(id, tsImporter);
|
|
732
|
+
if (!resolution && !id.endsWith(".d")) resolution = await this.resolve(`${id}.d`, tsImporter);
|
|
731
733
|
if (RE_NODE_MODULES.test(resolution?.id || id) || !isRelative(resolution?.id || id)) {
|
|
732
734
|
let shouldResolve;
|
|
733
735
|
if (typeof resolve === "boolean") shouldResolve = resolve;
|
|
@@ -751,7 +753,7 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclarations,
|
|
|
751
753
|
if (!resolution) return;
|
|
752
754
|
dtsId = resolution.id;
|
|
753
755
|
} else {
|
|
754
|
-
dtsId = filename_ts_to_dts(resolution.id);
|
|
756
|
+
dtsId = RE_DTS.test(resolution.id) ? resolution.id : filename_ts_to_dts(resolution.id);
|
|
755
757
|
if (dtsMap.has(dtsId)) return {
|
|
756
758
|
id: dtsId,
|
|
757
759
|
meta
|