Skip to content

Commit

Permalink
migrate to node 8 (fix cyclic dependencies bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
Idan Attias committed Dec 3, 2017
1 parent 96e00cc commit c6554dc
Show file tree
Hide file tree
Showing 4 changed files with 1,823 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: node_js
node_js:
- '0.10'
- '8'
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ module.exports = function generateRequireForUserCode (scopedDirs, options) {

function deleteModuleFromCache (m) {
delete Module._cache[m.id]
_.forEach(m.children, function (subModule) {
const moduleChildren = m.children
m.children = []
_.forEach(moduleChildren, function (subModule) {
deleteModuleFromCache(subModule)
})
m.children = []
}

return {
Expand Down
Loading

0 comments on commit c6554dc

Please sign in to comment.