rolldown-plugin-dts 0.16.7 → 0.16.8

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 +16 -14
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -961,26 +961,15 @@ function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = f
961
961
 
962
962
  //#endregion
963
963
  //#region src/resolver.ts
964
+ function isSourceFile(id) {
965
+ return RE_TS.test(id) || RE_VUE.test(id);
966
+ }
964
967
  function createDtsResolvePlugin({ tsconfig, resolve }) {
965
- const isSourceFile = (p) => RE_TS.test(p) || RE_JS.test(p) || RE_VUE.test(p);
966
- const shouldBundleNodeModule = (id) => {
967
- if (typeof resolve === "boolean") return resolve;
968
- return resolve.some((pattern) => typeof pattern === "string" ? id === pattern : pattern.test(id));
969
- };
970
968
  const baseDtsResolver = createResolver({
971
969
  tsconfig,
972
970
  resolveNodeModules: !!resolve,
973
971
  ResolverFactory
974
972
  });
975
- function resolveDtsPath(id, importer, rolldownResolution) {
976
- let dtsPath = baseDtsResolver(id, importer);
977
- if (dtsPath) dtsPath = path.normalize(dtsPath);
978
- if (!dtsPath || !isSourceFile(dtsPath)) {
979
- if (rolldownResolution && isFilePath(rolldownResolution.id) && isSourceFile(rolldownResolution.id) && !rolldownResolution.external) return rolldownResolution.id;
980
- return null;
981
- }
982
- return dtsPath;
983
- }
984
973
  return {
985
974
  name: "rolldown-plugin-dts:resolver",
986
975
  resolveId: {
@@ -1005,6 +994,19 @@ function createDtsResolvePlugin({ tsconfig, resolve }) {
1005
994
  }
1006
995
  }
1007
996
  };
997
+ function shouldBundleNodeModule(id) {
998
+ if (typeof resolve === "boolean") return resolve;
999
+ return resolve.some((pattern) => typeof pattern === "string" ? id === pattern : pattern.test(id));
1000
+ }
1001
+ function resolveDtsPath(id, importer, rolldownResolution) {
1002
+ let dtsPath = baseDtsResolver(id, importer);
1003
+ if (dtsPath) dtsPath = path.normalize(dtsPath);
1004
+ if (!dtsPath || !isSourceFile(dtsPath)) {
1005
+ if (rolldownResolution && isFilePath(rolldownResolution.id) && isSourceFile(rolldownResolution.id) && !rolldownResolution.external) return rolldownResolution.id;
1006
+ return null;
1007
+ }
1008
+ return dtsPath;
1009
+ }
1008
1010
  }
1009
1011
  function isFilePath(id) {
1010
1012
  return id.startsWith(".") || path.isAbsolute(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.16.7",
3
+ "version": "0.16.8",
4
4
  "description": "A Rolldown plugin to generate and bundle dts files.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -78,7 +78,7 @@
78
78
  "@types/babel__generator": "^7.27.0",
79
79
  "@types/debug": "^4.1.12",
80
80
  "@types/node": "^24.5.2",
81
- "@typescript/native-preview": "7.0.0-dev.20250920.1",
81
+ "@typescript/native-preview": "7.0.0-dev.20250921.1",
82
82
  "@volar/typescript": "^2.4.23",
83
83
  "@vue/language-core": "^3.0.7",
84
84
  "arktype": "^2.1.22",
@@ -91,7 +91,7 @@
91
91
  "rolldown-plugin-require-cjs": "^0.1.4",
92
92
  "rollup-plugin-dts": "^6.2.3",
93
93
  "tinyglobby": "^0.2.15",
94
- "tsdown": "^0.15.3",
94
+ "tsdown": "^0.15.4",
95
95
  "typescript": "^5.9.2",
96
96
  "vitest": "^3.2.4",
97
97
  "vue": "^3.5.21",