-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Reapply "fix:dynamic import as namespace import (#1171)" (#1208) This reverts commit 6e69d85. * release: @umijs/mako@0.4.18-canary.20240528.5 * chore: ⬆️ update pnpm-lock * release: @umijs/mako@0.5.5-canary.20240606.1 --------- Co-authored-by: Jinbao1001 <nodewebli@gmail.com> Co-authored-by: sorrycc <sorrycc@gmail.com>
- Loading branch information
1 parent
20462b3
commit 21526b6
Showing
11 changed files
with
132 additions
and
30 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
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
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
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
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,16 @@ | ||
const assert = require("assert"); | ||
const { | ||
parseBuildResult, | ||
moduleReg, | ||
injectSimpleJest, | ||
} = require("../../../scripts/test-utils"); | ||
const { files } = parseBuildResult(__dirname); | ||
|
||
injectSimpleJest(); | ||
|
||
const index = files["index.js"]; | ||
|
||
expect(index).toContain( | ||
'var interop = __mako_require__("@swc/helpers/_/_interop_require_wildcard")._;', | ||
); | ||
expect(index).toContain('then(__mako_require__.dr(interop, "src/cjs.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,5 @@ | ||
it("should interop cjs module with default", async () => { | ||
let cjs = await import("./src/cjs"); | ||
|
||
expect(cjs).toEqual({ default: { foo: 42 }, foo: 42 }); | ||
}); |
10 changes: 10 additions & 0 deletions
10
e2e/fixtures/runtime.dynamic_import_interop/mako.config.json
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 @@ | ||
{ | ||
"optimization": { | ||
"skipModules": false, | ||
"concatenateModules": false | ||
}, | ||
"entry": { | ||
"index": "./index.js" | ||
}, | ||
"moduleIdStrategy": "named" | ||
} |
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 @@ | ||
module.exports = { | ||
foo: 42, | ||
default: "ddd", | ||
}; |