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 +3 -3
- package/dist/index.js +7 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TsConfigJson } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 });
|