bio-dts 0.15.1 → 0.15.2
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/lib/generate-types.js +7 -3
- package/package.json +1 -1
package/lib/generate-types.js
CHANGED
|
@@ -151,15 +151,19 @@ export default function generateTypes(fileNames, compilerOptions, ts, generateOp
|
|
|
151
151
|
|
|
152
152
|
const combinedJSON = JSON.parse(JSON.stringify(combined));
|
|
153
153
|
|
|
154
|
-
// produce source maps with relative paths
|
|
155
|
-
|
|
154
|
+
// produce source maps with relative paths, following typescript conventions
|
|
155
|
+
const mapDir = path.dirname(path.resolve(fileName));
|
|
156
|
+
|
|
156
157
|
if (combinedJSON.sources) {
|
|
157
|
-
const mapDir = path.dirname(path.resolve(fileName));
|
|
158
158
|
combinedJSON.sources = combinedJSON.sources.map(src =>
|
|
159
159
|
path.relative(mapDir, path.resolve(src))
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
if (combinedJSON.file) {
|
|
164
|
+
combinedJSON.file = path.relative(mapDir, path.resolve(fileName));
|
|
165
|
+
}
|
|
166
|
+
|
|
163
167
|
// keep maps small, do not inline source text in declaration maps
|
|
164
168
|
delete combinedJSON.sourcesContent;
|
|
165
169
|
|