Skip to content

Commit

Permalink
fix: print ImportDeclarations' inner comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 20, 2022
1 parent cc49e97 commit b6d769e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-generator/src/generators/modules.ts
Expand Up @@ -179,6 +179,7 @@ export function ExportDefaultDeclaration(
export function ImportDeclaration(this: Printer, node: t.ImportDeclaration) {
this.word("import");
this.space();
this.printInnerComments(node);

const isTypeKind = node.importKind === "type" || node.importKind === "typeof";
if (isTypeKind) {
Expand Down
@@ -0,0 +1 @@
/* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
@@ -0,0 +1,3 @@
{
"plugins": ["importReflection"]
}
@@ -0,0 +1,12 @@
/* 0 */
import
/* 1 */
module
/* 2 */
from
/* 3 */
from
/* 4 */
"./module.wasm"
/* 5 */
;

0 comments on commit b6d769e

Please sign in to comment.