MDL-66307 js: Add missing plugintypes structure in subplugin read
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 1 Aug 2019 12:52:02 +0000 (20:52 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 1 Aug 2019 12:52:02 +0000 (20:52 +0800)
babel-plugin-add-module-to-define.js

index 2169dae..2779472 100644 (file)
@@ -72,7 +72,7 @@ module.exports = ({ template, types }) => {
             var rawContents = fs.readFileSync(file);
             var subplugins = JSON.parse(rawContents);
 
-            for (const [component, path] of Object.entries(subplugins)) {
+            for (const [component, path] of Object.entries(subplugins.plugintypes)) {
                 if (path) {
                     moodlePlugins[path] = component;
                 }
@@ -202,4 +202,4 @@ module.exports = ({ template, types }) => {
             }
         }
     };
-};
\ No newline at end of file
+};