Explorar o código

ES6 declaration was missing the enums.

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
edaf959f24
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      Tools/Gulp/gulp-addES6Exports.js

+ 10 - 0
Tools/Gulp/gulp-addES6Exports.js

@@ -34,6 +34,16 @@ globalObject["${base}"] = ${base}${(subModule && !extendsRoot) ? '.' + varName :
                 match = matcher.exec(fileContent);
             }
 
+            let enumMatcher = new RegExp(`\\(${base}\\.([A-Za-z0-9].*)= {}\\)`, "g");
+            let enumMatch = enumMatcher.exec(fileContent);
+            while (enumMatch != null) {
+                if (enumMatch[1]) {
+                    listOfExports.push(enumMatch[1]);
+                }
+                enumMatch = enumMatcher.exec(fileContent);
+            }
+
+
             let exportsText = '';
             listOfExports.forEach(cls => {
                 exportsText += `var ${cls} = ${base}.${cls};`;