Skip to content

Instantly share code, notes, and snippets.

@jamiebuilds
Created June 15, 2017 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiebuilds/2d5ebd002586324d0400135a1ef4498f to your computer and use it in GitHub Desktop.
Save jamiebuilds/2d5ebd002586324d0400135a1ef4498f to your computer and use it in GitHub Desktop.
import {inspect} from 'import-inspector';
const imported = [];
// setup a watcher
let stopInspecting = inspect(metadata => {
imported.push(metadata);
});
function flush() {
let copy = imported.slice();
imported.length = 0;
return copy;
}
render();
flush();
// [{ importedModulePath: "./module" }, ...]
render();
flush();
// [{ importedModulePath: "./module" }, ...]
stopInspecting();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment