﻿var Path = require('path');
var DEPENDENCIES = {};

module.exports = {
    setDependencies: function (depListOrRelativePathToFile) {
        if (!depListOrRelativePathToFile) throw new Error('Invalid dependency file or path to file');
        DEPENDENCIES = byTypeOf(depListOrRelativePathToFile);       
    },
    load: function (dependencyName) {
        var required = DEPENDENCIES[dependencyName]
            ? Path.join(process.cwd(), DEPENDENCIES[dependencyName])
            : dependencyName
        return require(required);
    }
}

function byTypeOf(depListOrRelativePathToFile) {
    switch (typeof depListOrRelativePathToFile) {
        case 'object': return depListOrRelativePathToFile;
        case 'string': return require(Path.join(process.cwd(), depListOrRelativePathToFile))
        default: throw new Error('Invalid dependency file or path to file');
    }
}
@@ -1,8 +1,9 @@
-%EF%BB%BFvar
+const
  Pat
@@ -25,13 +25,14 @@
 th')
-;%0Avar
+%0Aconst
  DEP
@@ -45,17 +45,16 @@
 IES = %7B%7D
-;
 %0A%0Amodule
@@ -85,27 +85,16 @@
 ndencies
-: function 
 (depList
@@ -213,25 +213,24 @@
 th to file')
-;
 %0A        DEP
@@ -282,10 +282,8 @@
 ile)
-; 
     
@@ -304,19 +304,8 @@
 load
-: function 
 (dep
@@ -331,11 +331,11 @@
     
-var
+let
  req
@@ -501,17 +501,16 @@
 equired)
-;
 %0A    %7D%0A%7D
@@ -841,13 +841,12 @@
 le')
-;
 %0A    %7D%0A%7D
@@ -837,16 +837,17 @@
 o file')%0A    %7D%0A%7D
+%0A

Update Loader.js