mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Use Reify to compile dynamic import(...).
This commit is contained in:
@@ -66,7 +66,9 @@ function stripHashBang(dataString) {
|
||||
}
|
||||
|
||||
const reifyCompileWithCache = wrap(function ({ dataString }) {
|
||||
return reifyCompile(stripHashBang(dataString)).code;
|
||||
return reifyCompile(stripHashBang(dataString), {
|
||||
dynamicImport: true,
|
||||
}).code;
|
||||
}, {
|
||||
makeCacheKey({ hash }) {
|
||||
return hash;
|
||||
|
||||
@@ -18,3 +18,8 @@ Mp.load = function (filename) {
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
const resolved = Promise.resolve();
|
||||
Mp.dynamicImport = function (id) {
|
||||
return resolved.then(() => require(id));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user