Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,7 @@ impl GenExpr for ImportExpression<'_> {
p.add_source_mapping(self.span);
p.print_str("import");
if let Some(phase) = self.phase {
p.print_ascii_byte(b'.');
p.print_str(phase.as_str());
}
p.print_ascii_byte(b'(');
Expand Down
12 changes: 11 additions & 1 deletion crates/oxc_codegen/tests/integration/esbuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,17 @@ fn test_import() {
test("import(/* before */ foo)", "import(\n\t/* before */\n\tfoo\n);\n");
test("import(/* before */ 'foo')", "import(\n\t/* before */\n\t\"foo\"\n);\n");
test("import(foo /* after */)", "import(\n\tfoo\n\t/* after */\n);\n");
test("import('foo' /* after */)", "import(\n\t\"foo\"\n\t/* after */\n);\n");
test("import('foo' /* after */)", "import(
\"foo\"
/* after */
);
");

// Test import.defer and import.source phases
test("import.defer(\"foo\");", "import.defer(\"foo\");
");
test("import.source(\"bar\");", "import.source(\"bar\");
");
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions tasks/coverage/node-compat-table
Submodule node-compat-table added at ed0d6b