Skip to content

Commit

Permalink
feat(index): implement PLATFORM.eachModule for webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Apr 7, 2016
1 parent b9c9aa5 commit 9bd90f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
@@ -1,3 +1,6 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc"
"extends": "./node_modules/aurelia-tools/.eslintrc",
"rules": {
"no-empty": 0
}
}
13 changes: 10 additions & 3 deletions src/index.js
Expand Up @@ -46,7 +46,6 @@ function ensureOriginOnExports(executed, name) {
* A default implementation of the Loader abstraction which works with webpack (extended common-js style).
*/
export class WebpackLoader extends Loader {

constructor() {
super();

Expand All @@ -62,6 +61,16 @@ export class WebpackLoader extends Loader {
return entry.templateIsLoaded ? entry : that.templateLoader.loadTemplate(that, entry).then(x => entry);
}
});

PLATFORM.eachModule = callback => {
let registry = this.moduleRegistry;

for (let key in registry) {
try {
if (callback(key, registry[key])) return;
} catch (e) {}
}
};
}

_import(moduleId) {
Expand Down Expand Up @@ -203,5 +212,3 @@ export class WebpackLoader extends Loader {
}

PLATFORM.Loader = WebpackLoader;

PLATFORM.eachModule = function(callback) {};

0 comments on commit 9bd90f4

Please sign in to comment.