-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiling duplicate ns imports to lazy CommonJS (#15941)
* Fix compiling duplicate ns imports to lazy CommonJS * Better types * whops
- Loading branch information
1 parent
b9a2244
commit ab36c3e
Showing
5 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
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
4 changes: 4 additions & 0 deletions
4
...in-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace-and-named/input.mjs
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,4 @@ | ||
import * as foo from "foo"; | ||
import { bar } from "foo"; | ||
|
||
console.log(foo, bar); |
10 changes: 10 additions & 0 deletions
10
...in-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace-and-named/output.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,10 @@ | ||
"use strict"; | ||
|
||
function foo() { | ||
const data = babelHelpers.interopRequireWildcard(require("foo")); | ||
foo = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
console.log(foo(), foo().bar); |
4 changes: 4 additions & 0 deletions
4
...gin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace-multiple/input.mjs
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,4 @@ | ||
import * as foo from "foo"; | ||
import * as foo2 from "foo"; | ||
|
||
console.log(foo, foo2); |
11 changes: 11 additions & 0 deletions
11
...gin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace-multiple/output.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,11 @@ | ||
"use strict"; | ||
|
||
function foo() { | ||
const data = babelHelpers.interopRequireWildcard(require("foo")); | ||
foo = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
var foo2 = foo; | ||
console.log(foo(), foo2()); |