@makano/rew 1.2.76 → 1.2.77
Sign up to get free protection for your applications and to get access to all the features.
@@ -97,6 +97,7 @@ module.exports.imp = function (runPath, context) {
|
|
97
97
|
if (ispkg) {
|
98
98
|
const pkg = getPackage(filename)(context, options);
|
99
99
|
exports = pkg._onImport ? pkg._onImport() : pkg;
|
100
|
+
if(options.useDefaultForPackages) exports = { default: exports };
|
100
101
|
} else if (foundCache) {
|
101
102
|
} else if (type == REW_FILE_TYPE.TYPE || type == "coffee") {
|
102
103
|
exports = exec({});
|
@@ -297,7 +297,18 @@ function compileRewStuff(content, options) {
|
|
297
297
|
|
298
298
|
if (nextLastToken?.value == 'assert') {
|
299
299
|
result += ', ';
|
300
|
+
const assertionToken = gnextToken(nextLastToken.ti, 2, tokens);
|
301
|
+
if(assertionToken.token.type == 'OTHER' && assertionToken.token.value == '{'){
|
302
|
+
hooks.push({
|
303
|
+
index: assertionToken.token.ti,
|
304
|
+
value: ' useDefaultForPackages: true, '
|
305
|
+
})
|
306
|
+
} else {
|
307
|
+
result += 'useDefaultForPackages: true, '
|
308
|
+
}
|
300
309
|
i += 3;
|
310
|
+
} else {
|
311
|
+
result += ", { useDefaultForPackages: true }"
|
301
312
|
}
|
302
313
|
|
303
314
|
continue;
|