title: Auto-scan for config files from ExtJS
body: <p>I am creating ExtJS 6.2 application from scratch. I am pretty new to this framework so I could use some help with scaffolding of application.</p>
  
  <p>The designed application is supposed to have separate 'plugins' that (on the code/packages level) will be totally separated. We also are having some kind of Router that will register some info per view name (path/controller/model/additional info). I would like it to be working in a way similar to the template method design pattern. When I add new plugin/module I also add file with specific name pattern - eg. ModuleACMEGlobalConf. I want ExtJS application (or component/class - whatever) to somehow scan whole class tree for files with such name pattern, read their contents and then put in my router config/global namespace variable.</p>
  
  <p>And the question is - what is the best way to achieve that?</p>
  
  <p>UPDATE:</p>
  
  <p>Structure I want to have:</p>
  
  <pre>
  MyAppFolder  
  ---Module1  
  .....MyConfigGlobal1.js  
  ---Module2  
  .....MyConfigGlobal2.js  
  ---  
  ---Router.js  -> I want this file to scan whole 'MyAppFolder' tree, find files with *ConfigGlobal*.js pattern, read them and store in global namespace  
  </pre>
  
  <p>MyConfigGlobal1.js</p>
  
  <pre><code>var config = { configProp1:  'test', configProp2:  'test2'}
  </code></pre>
  
  <p>MyConfigGlobal2.js</p>
  
  <pre><code>var config = {configProp3: 'test3', configProp4: 'test4'}
  </code></pre>
  
  <p>Router.js</p>
  
  <pre><code>var configsMap = EXT.SOMETHING.FIND.ME.CLASSES.FROM.TREE.WITH.NAME('*MyConfigGlobal*')
  </code></pre>
  
  <p>And I want the router to load everything (it can be on the class level, not file level) - whether it is one class or one hundred. And with this solution I do not have to change Router.js ever - just add another config class with in a new module I am creating. So there is no need to retest previous modules.</p>
  
  <p>But if I am having something like this in Router:</p>
  
  <pre><code>var requiredConfigs = ['MyGlobalConfig1.js','MyGlobalConfig2.js']
  </code></pre>
  
  <p>And I am about to add third file/class to this list in Router it means that the policy is broken and I have to retest module1 and module2 because code common for them in some way was modified. </p>