rolldown-plugin-dts 0.11.0 → 0.11.1

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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { TsConfigJson } from "/Users/kevin/Developer/open-source/rolldown-plugin-dts/node_modules/.pnpm/get-tsconfig@4.10.0/node_modules/get-tsconfig/dist/index.mjs";
2
- import { Plugin } from "/Users/kevin/Developer/open-source/rolldown-plugin-dts/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/index.mjs";
3
- import { IsolatedDeclarationsOptions } from "/Users/kevin/Developer/open-source/rolldown-plugin-dts/node_modules/.pnpm/rolldown@1.0.0-beta.8-commit.534fde3/node_modules/rolldown/dist/experimental-index.mjs";
1
+ import { TsConfigJson } from "get-tsconfig";
2
+ import { IsolatedDeclarationsOptions } from "rolldown/experimental";
3
+ import { Plugin } from "rolldown";
4
4
 
5
5
  //#region src/fake-js.d.ts
6
6
  declare function createFakeJsPlugin({
package/dist/index.js CHANGED
@@ -848,6 +848,11 @@ function createDtsResolvePlugin({ tsconfig, resolve }) {
848
848
  resolveId: {
849
849
  order: "pre",
850
850
  async handler(id, importer, options) {
851
+ const external = {
852
+ id,
853
+ external: true,
854
+ moduleSideEffects: false
855
+ };
851
856
  if (!importer || !RE_DTS.test(importer)) return;
852
857
  if (RE_CSS.test(id)) return {
853
858
  id,
@@ -857,22 +862,14 @@ function createDtsResolvePlugin({ tsconfig, resolve }) {
857
862
  let resolution = resolver(id, importer);
858
863
  if (!resolution || !RE_TS.test(resolution)) {
859
864
  const result = await this.resolve(id, importer, options);
860
- if (!result || !RE_TS.test(result.id)) return {
861
- id: result?.id || id,
862
- external: true,
863
- moduleSideEffects: false
864
- };
865
+ if (!result || !RE_TS.test(result.id)) return external;
865
866
  resolution = result.id;
866
867
  }
867
868
  if (!RE_NODE_MODULES.test(importer) && RE_NODE_MODULES.test(resolution)) {
868
869
  let shouldResolve;
869
870
  if (typeof resolve === "boolean") shouldResolve = resolve;
870
871
  else shouldResolve = resolve.some((pattern) => typeof pattern === "string" ? id === pattern : pattern.test(id));
871
- if (!shouldResolve) return {
872
- id,
873
- external: true,
874
- moduleSideEffects: false
875
- };
872
+ if (!shouldResolve) return external;
876
873
  }
877
874
  if (RE_TS.test(resolution) && !RE_DTS.test(resolution)) {
878
875
  await this.load({ id: resolution });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "A Rolldown plugin to bundle dts files",
5
5
  "type": "module",
6
6
  "license": "MIT",