Skip to content

Instantly share code, notes, and snippets.

@m-mujica
Forked from matthewp/who-imported.html
Created October 12, 2015 13:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m-mujica/0051f0b773a879d31b43 to your computer and use it in GitHub Desktop.
Save m-mujica/0051f0b773a879d31b43 to your computer and use it in GitHub Desktop.
Who imported me?
<script src="node_modules/steal/steal.js"></script>
<script>
var oldNormalize = System.normalize;
System.normalize = function(name, parentName){
return oldNormalize.apply(this, arguments).then(function(name){
if(name === "my/module") {
console.log(name, "is imported by", parentName);
}
return name;
});
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment