vite-plugin-dts 3.8.1 → 3.8.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/LICENSE +21 -21
- package/README.md +393 -393
- package/README.zh-CN.md +393 -393
- package/dist/index.cjs +7 -2
- package/dist/index.mjs +7 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -497,7 +497,7 @@ function transformCode(options) {
|
|
|
497
497
|
);
|
|
498
498
|
if (!options.staticImport) {
|
|
499
499
|
s.update(node.argument.literal.pos, node.argument.literal.end, `'${libName}'`);
|
|
500
|
-
return
|
|
500
|
+
return !!node.typeArguments;
|
|
501
501
|
}
|
|
502
502
|
const importSet = importMap.get(libName) ?? importMap.set(libName, /* @__PURE__ */ new Set()).get(libName);
|
|
503
503
|
let usedType = node.qualifier.escapedText;
|
|
@@ -536,7 +536,12 @@ function transformCode(options) {
|
|
|
536
536
|
return false;
|
|
537
537
|
}
|
|
538
538
|
if (ts__default.isModuleDeclaration(node)) {
|
|
539
|
-
|
|
539
|
+
if (node.body && ts__default.isModuleBlock(node.body) && !node.body.statements.some(
|
|
540
|
+
(s2) => ts__default.isExportAssignment(s2) || ts__default.isExportDeclaration(s2) || ts__default.isImportDeclaration(s2)
|
|
541
|
+
)) {
|
|
542
|
+
declareModules.push(s.slice(node.pos, node.end + 1));
|
|
543
|
+
}
|
|
544
|
+
return false;
|
|
540
545
|
}
|
|
541
546
|
});
|
|
542
547
|
importMap.forEach((importSet, libName) => {
|
package/dist/index.mjs
CHANGED
|
@@ -494,7 +494,7 @@ function transformCode(options) {
|
|
|
494
494
|
);
|
|
495
495
|
if (!options.staticImport) {
|
|
496
496
|
s.update(node.argument.literal.pos, node.argument.literal.end, `'${libName}'`);
|
|
497
|
-
return
|
|
497
|
+
return !!node.typeArguments;
|
|
498
498
|
}
|
|
499
499
|
const importSet = importMap.get(libName) ?? importMap.set(libName, /* @__PURE__ */ new Set()).get(libName);
|
|
500
500
|
let usedType = node.qualifier.escapedText;
|
|
@@ -533,7 +533,12 @@ function transformCode(options) {
|
|
|
533
533
|
return false;
|
|
534
534
|
}
|
|
535
535
|
if (ts.isModuleDeclaration(node)) {
|
|
536
|
-
|
|
536
|
+
if (node.body && ts.isModuleBlock(node.body) && !node.body.statements.some(
|
|
537
|
+
(s2) => ts.isExportAssignment(s2) || ts.isExportDeclaration(s2) || ts.isImportDeclaration(s2)
|
|
538
|
+
)) {
|
|
539
|
+
declareModules.push(s.slice(node.pos, node.end + 1));
|
|
540
|
+
}
|
|
541
|
+
return false;
|
|
537
542
|
}
|
|
538
543
|
});
|
|
539
544
|
importMap.forEach((importSet, libName) => {
|