-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
S-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid buggood first issueGood for newcomersGood for newcomers
Description
期望
ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#return_value
( import(...) ) Returns a promise which fulfills to a module namespace object: an object containing all exports from moduleName.
翻译成代码说:
import * as mod from "/my-module.js";
import("/my-module.js").then((mod2) => {
console.log(mod === mod2); // true
});实际
import ("react")
.then((m)=>{
// m.default is undefined
})found by @Jinbao1001
解
原来 import("foo/index.js") 翻译为
Promise.all([
__mako_require__.ensure("foo/index.js")
]).then(__mako_require__.bind(__mako_require__, "foo/index.js"))...需要调整为
const wildcard_interop = require("interop")
Promise.all([
__mako_require__.ensure("foo/index.js")
]).then(()=>wildcard_interop(__mako_require__("foo/index.js"))...Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
S-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid buggood first issueGood for newcomersGood for newcomers