rolldown-plugin-dts 0.7.11 → 0.7.13

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -244,7 +244,7 @@ function createFakeJsPlugin({ dtsInput }) {
244
244
  entryFileNames: options.entryFileNames ?? (dtsInput ? "[name].ts" : void 0),
245
245
  chunkFileNames(chunk) {
246
246
  const original = (typeof options.chunkFileNames === "function" ? options.chunkFileNames(chunk) : options.chunkFileNames) || "[name]-[hash].js";
247
- if (chunk.name.endsWith(".d")) return filename_js_to_dts(original);
247
+ if (!original.includes(".d") && chunk.name.endsWith(".d")) return filename_js_to_dts(original);
248
248
  return original;
249
249
  }
250
250
  };
@@ -618,7 +618,7 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclaration:
618
618
  ...options,
619
619
  entryFileNames(chunk) {
620
620
  const original = (typeof options.entryFileNames === "function" ? options.entryFileNames(chunk) : options.entryFileNames) || "[name].js";
621
- if (chunk.name.endsWith(".d")) return original.replace(RE_JS, ".$1ts");
621
+ if (!original.includes(".d") && chunk.name.endsWith(".d")) return original.replace(RE_JS, ".$1ts");
622
622
  return original;
623
623
  }
624
624
  };
@@ -665,9 +665,15 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclaration:
665
665
  meta
666
666
  };
667
667
  }
668
+ if (RE_NODE_MODULES.test(importer)) {
669
+ const resolution$1 = resolver(id, importer);
670
+ if (resolution$1) return {
671
+ id: resolution$1,
672
+ meta
673
+ };
674
+ }
668
675
  let resolution = await this.resolve(id, filename_dts_to(importer, "ts"));
669
- if (!resolution) return;
670
- if (RE_NODE_MODULES.test(resolution.id) || !isRelative(resolution.id)) {
676
+ if (RE_NODE_MODULES.test(resolution?.id || id) || !isRelative(resolution?.id || id)) {
671
677
  let shouldResolve;
672
678
  if (typeof resolve === "boolean") shouldResolve = resolve;
673
679
  else shouldResolve = resolve.some((pattern) => typeof pattern === "string" ? id === pattern : pattern.test(id));
@@ -682,7 +688,8 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclaration:
682
688
  external: true,
683
689
  meta
684
690
  };
685
- } else if (resolution.external) return resolution;
691
+ }
692
+ if (!resolution || resolution.external) return resolution;
686
693
  let dtsId;
687
694
  if (RE_JS.test(resolution.id)) {
688
695
  resolution = await this.resolve(filename_js_to_dts(resolution.id), importer, { skipSelf: false });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.7.11",
3
+ "version": "0.7.13",
4
4
  "description": "A Rolldown plugin to bundle dts files",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -53,12 +53,12 @@
53
53
  "@types/node": "^22.14.1",
54
54
  "bumpp": "^10.1.0",
55
55
  "diff": "^7.0.0",
56
- "eslint": "^9.24.0",
56
+ "eslint": "^9.25.0",
57
57
  "estree-walker": "^3.0.3",
58
58
  "prettier": "^3.5.3",
59
59
  "rolldown": "^1.0.0-beta.7",
60
60
  "rollup-plugin-dts": "^6.2.1",
61
- "tsdown": "^0.8.0",
61
+ "tsdown": "^0.8.1",
62
62
  "tsx": "^4.19.3",
63
63
  "typescript": "^5.8.3",
64
64
  "vitest": "^3.1.1"