Skip to content

Commit 41cc589

Browse files
committed
WIP on getting require cycles working
1 parent 87a6096 commit 41cc589

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ExportMap.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ ExportMap.parse = function (path, content, context) {
409409
processDynamicImport(node.source);
410410
},
411411
CallExpression(node) {
412-
if (node.callee.type === 'Import') {
412+
if (node.callee.type === 'Import' ||
413+
(node.callee.type === 'Identifier' && node.callee.name === 'require')) {
413414
processDynamicImport(node.arguments[0]);
414415
}
415416
},

utils/unambiguous.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*=]))|import\(/m;
1313
* @type {RegExp}
1414
*/
1515
exports.test = function isMaybeUnambiguousModule(content) {
16-
return pattern.test(content);
16+
return true;
17+
// return pattern.test(content);
1718
};
1819

1920
// future-/Babel-proof at the expense of being a little loose

0 commit comments

Comments
 (0)