vite-plugin-dts 4.2.3-dev.0 → 4.2.3-dev.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.cjs +4 -6
- package/dist/index.mjs +4 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -617,18 +617,16 @@ function transformCode(options) {
|
|
|
617
617
|
);
|
|
618
618
|
return false;
|
|
619
619
|
}
|
|
620
|
-
if (ts__default.isModuleDeclaration(node)) {
|
|
621
|
-
if (node.
|
|
620
|
+
if (ts__default.isModuleDeclaration(node) && node.body && ts__default.isModuleBlock(node.body)) {
|
|
621
|
+
if (ts__default.isIdentifier(node.name) && node.name.escapedText === "global" && node.body.statements.some(isVLSNode)) {
|
|
622
|
+
s.remove(node.pos, node.end + 1);
|
|
623
|
+
} else if (node.modifiers?.[0] && node.modifiers[0].kind === ts__default.SyntaxKind.DeclareKeyword && !node.body.statements.some(
|
|
622
624
|
(s2) => ts__default.isExportAssignment(s2) || ts__default.isExportDeclaration(s2) || ts__default.isImportDeclaration(s2)
|
|
623
625
|
)) {
|
|
624
626
|
declareModules.push(s.slice(node.pos, node.end + 1));
|
|
625
627
|
}
|
|
626
628
|
return false;
|
|
627
629
|
}
|
|
628
|
-
if (ts__default.isModuleDeclaration(node) && node.body && ts__default.isModuleBlock(node.body) && ts__default.isIdentifier(node.name) && node.name.escapedText === "global" && node.body.statements.some(isVLSNode)) {
|
|
629
|
-
s.remove(node.pos, node.end + 1);
|
|
630
|
-
return false;
|
|
631
|
-
}
|
|
632
630
|
});
|
|
633
631
|
let prependImports = "";
|
|
634
632
|
importMap.forEach((importSet, libName) => {
|
package/dist/index.mjs
CHANGED
|
@@ -613,18 +613,16 @@ function transformCode(options) {
|
|
|
613
613
|
);
|
|
614
614
|
return false;
|
|
615
615
|
}
|
|
616
|
-
if (ts.isModuleDeclaration(node)) {
|
|
617
|
-
if (node.
|
|
616
|
+
if (ts.isModuleDeclaration(node) && node.body && ts.isModuleBlock(node.body)) {
|
|
617
|
+
if (ts.isIdentifier(node.name) && node.name.escapedText === "global" && node.body.statements.some(isVLSNode)) {
|
|
618
|
+
s.remove(node.pos, node.end + 1);
|
|
619
|
+
} else if (node.modifiers?.[0] && node.modifiers[0].kind === ts.SyntaxKind.DeclareKeyword && !node.body.statements.some(
|
|
618
620
|
(s2) => ts.isExportAssignment(s2) || ts.isExportDeclaration(s2) || ts.isImportDeclaration(s2)
|
|
619
621
|
)) {
|
|
620
622
|
declareModules.push(s.slice(node.pos, node.end + 1));
|
|
621
623
|
}
|
|
622
624
|
return false;
|
|
623
625
|
}
|
|
624
|
-
if (ts.isModuleDeclaration(node) && node.body && ts.isModuleBlock(node.body) && ts.isIdentifier(node.name) && node.name.escapedText === "global" && node.body.statements.some(isVLSNode)) {
|
|
625
|
-
s.remove(node.pos, node.end + 1);
|
|
626
|
-
return false;
|
|
627
|
-
}
|
|
628
626
|
});
|
|
629
627
|
let prependImports = "";
|
|
630
628
|
importMap.forEach((importSet, libName) => {
|