mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 06:05:02 +03:00
fix(es): Fix bugs (#2403)
swc: - Ensure that #2114 is fixed. - Ensure that #2310 is fixed.
This commit is contained in:
parent
4ad25d2155
commit
6366d05fd3
8
tests/fixture/issue-2214/input/.swcrc
Normal file
8
tests/fixture/issue-2214/input/.swcrc
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": true
|
||||
}
|
||||
}
|
||||
}
|
5
tests/fixture/issue-2214/input/index.tsx
Normal file
5
tests/fixture/issue-2214/input/index.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export module Test {
|
||||
export const content = <div>Content</div>;
|
||||
}
|
6
tests/fixture/issue-2214/output/index.tsx
Normal file
6
tests/fixture/issue-2214/output/index.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
import React from "react";
|
||||
export var Test;
|
||||
(function(Test) {
|
||||
Test.content = /*#__PURE__*/ React.createElement("div", null, "Content");
|
||||
})(Test || (Test = {
|
||||
}));
|
5
tests/fixture/issue-2310/input/index.tsx
Normal file
5
tests/fixture/issue-2310/input/index.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
namespace A {
|
||||
export const Foo = () => {
|
||||
return <div></div>;
|
||||
};
|
||||
}
|
7
tests/fixture/issue-2310/output/index.tsx
Normal file
7
tests/fixture/issue-2310/output/index.tsx
Normal file
@ -0,0 +1,7 @@
|
||||
var A;
|
||||
(function(A) {
|
||||
A.Foo = function() {
|
||||
return(/*#__PURE__*/ React.createElement("div", null));
|
||||
};
|
||||
})(A || (A = {
|
||||
}));
|
Loading…
Reference in New Issue
Block a user