rolldown-plugin-dts 0.7.1 → 0.7.2

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 +5 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { MagicStringAST } from "magic-string-ast";
2
2
  import { parseSync } from "oxc-parser";
3
3
  import path from "node:path";
4
- import process from "node:process";
5
4
  import { createResolver } from "dts-resolver";
6
5
  import { getTsconfig } from "get-tsconfig";
7
6
  import { isolatedDeclaration } from "oxc-transform";
@@ -579,7 +578,7 @@ function createGeneratePlugin({ compilerOptions, isolatedDeclaration: isolatedDe
579
578
  let programs = [];
580
579
  return {
581
580
  name: "rolldown-plugin-dts:generate",
582
- buildStart(options) {
581
+ async buildStart(options) {
583
582
  if (!compilerOptions) {
584
583
  const { config } = getTsconfig(options.cwd) || {};
585
584
  compilerOptions = config?.compilerOptions;
@@ -588,12 +587,10 @@ function createGeneratePlugin({ compilerOptions, isolatedDeclaration: isolatedDe
588
587
  if (isolatedDeclaration$1 === true) isolatedDeclaration$1 = {};
589
588
  if (isolatedDeclaration$1 && isolatedDeclaration$1.stripInternal == null) isolatedDeclaration$1.stripInternal = !!compilerOptions?.stripInternal;
590
589
  if (!isolatedDeclaration$1) initTs();
591
- if (!Array.isArray(options.input)) {
592
- const cwd = options.cwd || process.cwd();
593
- for (const [fileName, inputFilePath] of Object.entries(options.input)) {
594
- const id = path.resolve(cwd, inputFilePath);
595
- inputAliasMap.set(id, fileName);
596
- }
590
+ if (!Array.isArray(options.input)) for (const [name, id] of Object.entries(options.input)) {
591
+ let resolved = await this.resolve(id, void 0, { skipSelf: true });
592
+ resolved ||= await this.resolve(`./${id}`, void 0, { skipSelf: true });
593
+ inputAliasMap.set(resolved?.id || id, name);
597
594
  }
598
595
  },
599
596
  outputOptions(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "A Rolldown plugin to bundle dts files",
5
5
  "type": "module",
6
6
  "license": "MIT",