Skip to content

Commit

Permalink
fix(es): Fix bugs (#2403)
Browse files Browse the repository at this point in the history
swc:
 - Ensure that #2114 is fixed.
 - Ensure that #2310 is fixed.
  • Loading branch information
kdy1 authored Oct 11, 2021
1 parent 4ad25d2 commit 6366d05
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fixture/issue-2214/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
}
}
}
5 changes: 5 additions & 0 deletions tests/fixture/issue-2214/input/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

export module Test {
export const content = <div>Content</div>;
}
6 changes: 6 additions & 0 deletions tests/fixture/issue-2214/output/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
export var Test;
(function(Test) {
Test.content = /*#__PURE__*/ React.createElement("div", null, "Content");
})(Test || (Test = {
}));
5 changes: 5 additions & 0 deletions tests/fixture/issue-2310/input/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace A {
export const Foo = () => {
return <div></div>;
};
}
7 changes: 7 additions & 0 deletions tests/fixture/issue-2310/output/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var A;
(function(A) {
A.Foo = function() {
return(/*#__PURE__*/ React.createElement("div", null));
};
})(A || (A = {
}));

0 comments on commit 6366d05

Please sign in to comment.