rolldown-plugin-dts 0.10.0 → 0.10.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.js +2 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -261,24 +261,6 @@ function createFakeJsPlugin({ dtsInput, sourcemap }) {
|
|
|
261
261
|
}
|
|
262
262
|
return {
|
|
263
263
|
name: "rolldown-plugin-dts:fake-js",
|
|
264
|
-
options: dtsInput ? (options) => {
|
|
265
|
-
return {
|
|
266
|
-
...options,
|
|
267
|
-
resolve: {
|
|
268
|
-
extensions: [
|
|
269
|
-
".d.ts",
|
|
270
|
-
".d.mts",
|
|
271
|
-
".d.cts"
|
|
272
|
-
],
|
|
273
|
-
extensionAlias: {
|
|
274
|
-
".js": [".d.ts"],
|
|
275
|
-
".mjs": [".d.mts"],
|
|
276
|
-
".cjs": [".d.cts"]
|
|
277
|
-
},
|
|
278
|
-
...options.resolve
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
} : void 0,
|
|
282
264
|
outputOptions(options) {
|
|
283
265
|
if (options.format === "cjs" || options.format === "commonjs") throw new Error("[rolldown-plugin-dts] Cannot bundle dts files with `cjs` format.");
|
|
284
266
|
return {
|
|
@@ -854,7 +836,6 @@ function createGeneratePlugin({ compilerOptions = {}, isolatedDeclarations, emit
|
|
|
854
836
|
|
|
855
837
|
//#endregion
|
|
856
838
|
//#region src/resolve.ts
|
|
857
|
-
const meta = { dtsFile: true };
|
|
858
839
|
function createDtsResolvePlugin({ tsconfig, resolve }) {
|
|
859
840
|
const resolver = createResolver({
|
|
860
841
|
tsconfig,
|
|
@@ -870,7 +851,7 @@ function createDtsResolvePlugin({ tsconfig, resolve }) {
|
|
|
870
851
|
external: true,
|
|
871
852
|
moduleSideEffects: false
|
|
872
853
|
};
|
|
873
|
-
if (!importer || !RE_DTS.test(importer)
|
|
854
|
+
if (!importer || !RE_DTS.test(importer)) return;
|
|
874
855
|
if (RE_CSS.test(id)) return {
|
|
875
856
|
id,
|
|
876
857
|
external: true,
|
|
@@ -892,11 +873,7 @@ function createDtsResolvePlugin({ tsconfig, resolve }) {
|
|
|
892
873
|
await Promise.any([this.load({ id: resolution }), new Promise((resolve$1) => setTimeout(resolve$1, 200))]);
|
|
893
874
|
resolution = filename_ts_to_dts(resolution);
|
|
894
875
|
}
|
|
895
|
-
if (RE_DTS.test(resolution)) return
|
|
896
|
-
id: resolution,
|
|
897
|
-
meta,
|
|
898
|
-
moduleSideEffects: false
|
|
899
|
-
};
|
|
876
|
+
if (RE_DTS.test(resolution)) return resolution;
|
|
900
877
|
}
|
|
901
878
|
}
|
|
902
879
|
};
|