Skip to content

Commit

Permalink
WIP on getting require cycles working
Browse files Browse the repository at this point in the history
  • Loading branch information
srsudar committed Feb 4, 2023
1 parent 87a6096 commit 41cc589
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ExportMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ ExportMap.parse = function (path, content, context) {
processDynamicImport(node.source);
},
CallExpression(node) {
if (node.callee.type === 'Import') {
if (node.callee.type === 'Import' ||
(node.callee.type === 'Identifier' && node.callee.name === 'require')) {
processDynamicImport(node.arguments[0]);
}
},
Expand Down
3 changes: 2 additions & 1 deletion utils/unambiguous.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[{*=]))|import\(/m;
* @type {RegExp}
*/
exports.test = function isMaybeUnambiguousModule(content) {
return pattern.test(content);
return true;
// return pattern.test(content);
};

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

0 comments on commit 41cc589

Please sign in to comment.