Created
June 15, 2017 22:11
-
-
Save jamiebuilds/2d5ebd002586324d0400135a1ef4498f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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