rolldown-plugin-dts 0.16.0 → 0.16.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.
|
@@ -70,6 +70,13 @@ const stripPrivateFields = (ctx) => {
|
|
|
70
70
|
return (sourceFile) => ts.visitNode(sourceFile, visitor, ts.isSourceFile) ?? sourceFile;
|
|
71
71
|
};
|
|
72
72
|
const customTransformers = { afterDeclarations: [stripPrivateFields] };
|
|
73
|
+
function setSourceMapRoot(map, originalFilePath, finalFilePath) {
|
|
74
|
+
if (!map) return;
|
|
75
|
+
if (map.sourceRoot) return;
|
|
76
|
+
const originalDir = path.posix.dirname(pathToFileURL(originalFilePath).pathname);
|
|
77
|
+
const finalDir = path.posix.dirname(pathToFileURL(finalFilePath).pathname);
|
|
78
|
+
if (originalDir !== finalDir) map.sourceRoot = path.posix.relative(finalDir, originalDir);
|
|
79
|
+
}
|
|
73
80
|
|
|
74
81
|
//#endregion
|
|
75
82
|
//#region src/tsc/emit-build.ts
|
|
@@ -109,10 +116,7 @@ function tscEmitBuild(tscOptions) {
|
|
|
109
116
|
continue;
|
|
110
117
|
}
|
|
111
118
|
map = JSON.parse(text);
|
|
112
|
-
|
|
113
|
-
const outputFileDir = path.posix.dirname(pathToFileURL(outputFile).pathname);
|
|
114
|
-
const resolvedIdDir = path.posix.dirname(pathToFileURL(resolvedId).pathname);
|
|
115
|
-
if (outputFileDir !== resolvedIdDir) map.sourceRoot = path.posix.relative(resolvedIdDir, outputFileDir);
|
|
119
|
+
setSourceMapRoot(map, outputFile, resolvedId);
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
if (code) return {
|
|
@@ -360,6 +364,7 @@ function tscEmitCompiler(tscOptions) {
|
|
|
360
364
|
if (fileName.endsWith(".map")) {
|
|
361
365
|
debug$1(`emit dts sourcemap: ${fileName}`);
|
|
362
366
|
map = JSON.parse(code);
|
|
367
|
+
setSourceMapRoot(map, fileName, tscOptions.id);
|
|
363
368
|
} else {
|
|
364
369
|
debug$1(`emit dts: ${fileName}`);
|
|
365
370
|
dtsCode = code;
|
package/dist/tsc-worker.js
CHANGED
package/dist/tsc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "A Rolldown plugin to generate and bundle dts files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@babel/generator": "^7.28.3",
|
|
61
|
-
"@babel/parser": "^7.28.
|
|
62
|
-
"@babel/types": "^7.28.
|
|
61
|
+
"@babel/parser": "^7.28.4",
|
|
62
|
+
"@babel/types": "^7.28.4",
|
|
63
63
|
"ast-kit": "^2.1.2",
|
|
64
64
|
"birpc": "^2.5.0",
|
|
65
65
|
"debug": "^4.4.1",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"@sxzz/test-utils": "^0.5.10",
|
|
73
73
|
"@types/babel__generator": "^7.27.0",
|
|
74
74
|
"@types/debug": "^4.1.12",
|
|
75
|
-
"@types/node": "^24.3.
|
|
76
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
75
|
+
"@types/node": "^24.3.1",
|
|
76
|
+
"@typescript/native-preview": "7.0.0-dev.20250906.1",
|
|
77
77
|
"@volar/typescript": "^2.4.23",
|
|
78
78
|
"@vue/language-core": "^3.0.6",
|
|
79
79
|
"bumpp": "^10.2.3",
|
|
80
80
|
"diff": "^8.0.2",
|
|
81
|
-
"eslint": "^9.
|
|
81
|
+
"eslint": "^9.35.0",
|
|
82
82
|
"estree-walker": "^3.0.3",
|
|
83
83
|
"prettier": "^3.6.2",
|
|
84
|
-
"rolldown": "^1.0.0-beta.
|
|
84
|
+
"rolldown": "^1.0.0-beta.35",
|
|
85
85
|
"rollup-plugin-dts": "^6.2.3",
|
|
86
86
|
"tinyglobby": "^0.2.14",
|
|
87
87
|
"tsdown": "^0.14.2",
|