-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/module): Resolve
.jsx
imports fully (#8936)
**Related issue:** - Closes #8935
- Loading branch information
Showing
15 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/fixture/issues-8xxx/8184/1/output/src/a/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from "react"; | ||
var a = function(props) { | ||
return /*#__PURE__*/ React.createElement("div", null); | ||
}; | ||
a.propTypes = {}; | ||
export default a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"module": { | ||
"type": "es6", | ||
"resolveFully": true | ||
}, | ||
"jsc": { | ||
"baseUrl": ".", | ||
"parser": { | ||
"syntax": "ecmascript", | ||
"jsx": true | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/swc/tests/fixture/issues-8xxx/8935/input/src/button.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function Button(props) { | ||
return <button {...props} />; | ||
}export function Button(props) { | ||
return <button {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function greet() { | ||
return "Hello"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { greet } from "./greet"; | ||
export { Button } from "./button"; |
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/fixture/issues-8xxx/8935/output/src/button.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export function Button(props) { | ||
return /*#__PURE__*/ React.createElement("button", props); | ||
} | ||
export function Button(props) { | ||
return /*#__PURE__*/ React.createElement("button", props); | ||
} |
3 changes: 3 additions & 0 deletions
3
crates/swc/tests/fixture/issues-8xxx/8935/output/src/greet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function greet() { | ||
return "Hello"; | ||
} |
2 changes: 2 additions & 0 deletions
2
crates/swc/tests/fixture/issues-8xxx/8935/output/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { greet } from "./greet.js"; | ||
export { Button } from "./button.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_module/tests/paths/issue-4605/2/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import "./src/rel.decorator"; | ||
import "./src/rel.decorator.js"; |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_module/tests/paths/issue-4607/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import boo from "./src/utils/shared/foo/boo"; | ||
import boo from "./src/utils/shared/foo/boo.js"; | ||
console.log(boo()); |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_module/tests/paths/issue-4619/2/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import "./src/rel.decorator"; | ||
import "./src/rel.decorator.js"; |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_module/tests/paths/issue-6779/1/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
async function main() { | ||
const addFunction = (await import("./add")).default // This doesn't work | ||
const addFunction = (await import("./add.js")).default // This doesn't work | ||
; | ||
console.log('2 + 3 =', addFunction(2, 3)); | ||
} |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_module/tests/paths/issue-6779/2/output/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import addFunction from "./add"; | ||
import addFunction from "./add.js"; | ||
async function main() { | ||
console.log('2 + 3 =', addFunction(2, 3)); | ||
} |