-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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): Read link if an import is resolved as symlink (#8297)
**Related issue:** - Closes #8265
- Loading branch information
Showing
16 changed files
with
353 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es2021", | ||
"baseUrl": "./src", | ||
"paths": { | ||
"@modules/*": [ | ||
"./modules/*" | ||
] | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
}, | ||
} |
3 changes: 3 additions & 0 deletions
3
crates/swc/tests/fixture/issues-8xxx/8265/1/input/src/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { moduleA } from "@modules/moduleA"; | ||
|
||
moduleA(); |
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/fixture/issues-8xxx/8265/1/input/src/modules/moduleA/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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { moduleB } from "@modules/moduleB"; | ||
|
||
export const moduleA = () => { | ||
console.log("This is module A"); | ||
moduleB(); | ||
}; |
1 change: 1 addition & 0 deletions
1
crates/swc/tests/fixture/issues-8xxx/8265/1/input/src/modules/moduleB/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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const moduleB = () => console.log("This is module B!"); |
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/fixture/issues-8xxx/8265/1/output/src/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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
const _moduleA = require("./modules/moduleA"); | ||
(0, _moduleA.moduleA)(); |
15 changes: 15 additions & 0 deletions
15
crates/swc/tests/fixture/issues-8xxx/8265/1/output/src/modules/moduleA/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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "moduleA", { | ||
enumerable: true, | ||
get: function() { | ||
return moduleA; | ||
} | ||
}); | ||
const _moduleB = require("../moduleB"); | ||
const moduleA = ()=>{ | ||
console.log("This is module A"); | ||
(0, _moduleB.moduleB)(); | ||
}; |
11 changes: 11 additions & 0 deletions
11
crates/swc/tests/fixture/issues-8xxx/8265/1/output/src/modules/moduleB/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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "moduleB", { | ||
enumerable: true, | ||
get: function() { | ||
return moduleB; | ||
} | ||
}); | ||
const moduleB = ()=>console.log("This is module B!"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//! Used for testing | ||
fn main() -> anyhow::Result<()> { | ||
swc_cli_impl::run() | ||
} |
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,18 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript" | ||
}, | ||
"target": "es2021", | ||
"baseUrl": "./src", | ||
"paths": { | ||
"@modules/*": [ | ||
"./modules/*" | ||
] | ||
} | ||
}, | ||
"module": { | ||
"type": "commonjs" | ||
}, | ||
"sourceMaps": true | ||
} |
Oops, something went wrong.