rolldown-plugin-dts 0.8.4 → 0.8.6
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 +13 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -31,6 +31,15 @@ function isRelative(id) {
|
|
|
31
31
|
function createDtsInputPlugin() {
|
|
32
32
|
return {
|
|
33
33
|
name: "rolldown-plugin-dts:dts-input",
|
|
34
|
+
options(options) {
|
|
35
|
+
return {
|
|
36
|
+
treeshake: options.treeshake !== false ? {
|
|
37
|
+
...options.treeshake === true ? {} : options.treeshake,
|
|
38
|
+
moduleSideEffects: false
|
|
39
|
+
} : false,
|
|
40
|
+
...options
|
|
41
|
+
};
|
|
42
|
+
},
|
|
34
43
|
outputOptions(options) {
|
|
35
44
|
return {
|
|
36
45
|
...options,
|
|
@@ -727,7 +736,9 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclarations,
|
|
|
727
736
|
meta
|
|
728
737
|
};
|
|
729
738
|
}
|
|
730
|
-
|
|
739
|
+
const tsImporter = filename_dts_to(importer, "ts");
|
|
740
|
+
let resolution = await this.resolve(id, tsImporter);
|
|
741
|
+
if (!resolution && !id.endsWith(".d")) resolution = await this.resolve(`${id}.d`, tsImporter);
|
|
731
742
|
if (RE_NODE_MODULES.test(resolution?.id || id) || !isRelative(resolution?.id || id)) {
|
|
732
743
|
let shouldResolve;
|
|
733
744
|
if (typeof resolve === "boolean") shouldResolve = resolve;
|
|
@@ -751,7 +762,7 @@ function createGeneratePlugin({ tsconfig, compilerOptions, isolatedDeclarations,
|
|
|
751
762
|
if (!resolution) return;
|
|
752
763
|
dtsId = resolution.id;
|
|
753
764
|
} else {
|
|
754
|
-
dtsId = filename_ts_to_dts(resolution.id);
|
|
765
|
+
dtsId = RE_DTS.test(resolution.id) ? resolution.id : filename_ts_to_dts(resolution.id);
|
|
755
766
|
if (dtsMap.has(dtsId)) return {
|
|
756
767
|
id: dtsId,
|
|
757
768
|
meta
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "A Rolldown plugin to bundle dts files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"eslint": "^9.25.1",
|
|
57
57
|
"estree-walker": "^3.0.3",
|
|
58
58
|
"prettier": "^3.5.3",
|
|
59
|
-
"rolldown": "1.0.0-beta.
|
|
59
|
+
"rolldown": "1.0.0-beta.8-commit.6aca0ce",
|
|
60
60
|
"rollup-plugin-dts": "^6.2.1",
|
|
61
61
|
"tsdown": "^0.9.6",
|
|
62
62
|
"tsx": "^4.19.3",
|