diff --git a/methods/actions.js b/methods/actions.js index db151c0..0882096 100644 --- a/methods/actions.js +++ b/methods/actions.js @@ -1,4 +1,11 @@ -const importFresh = require('import-fresh'); +var fs = require('fs'); +var path = require("path"); +if (fs.existsSync(path.join(process.cwd() + "/npm"))) { + var rootModules = path.join(process.cwd() + '/npm/node_modules/') +} else{ + var rootModules = '' +} +const importFresh = require(rootModules+'import-fresh'); var remuxContainer = importFresh('./library/actions/remuxContainer.js') diff --git a/methods/filters.js b/methods/filters.js index 43bb570..925d401 100644 --- a/methods/filters.js +++ b/methods/filters.js @@ -1,4 +1,11 @@ -const importFresh = require('import-fresh'); +var fs = require('fs'); +var path = require("path"); +if (fs.existsSync(path.join(process.cwd() + "/npm"))) { + var rootModules = path.join(process.cwd() + '/npm/node_modules/') +} else{ + var rootModules = '' +} +const importFresh = require(rootModules+'import-fresh'); var filterByAge = importFresh('./library/filters/filterByAge.js') diff --git a/methods/library.js b/methods/library.js index a1095b7..6e41e43 100644 --- a/methods/library.js +++ b/methods/library.js @@ -1,13 +1,10 @@ - var fs = require('fs'); var path = require("path"); - if (fs.existsSync(path.join(process.cwd() + "/npm"))) { var rootModules = path.join(process.cwd() + '/npm/node_modules/') } else{ var rootModules = '' } - const importFresh = require(rootModules+'import-fresh'); var filters = importFresh('./filters.js')