3 changed files with 23 additions and 3 deletions
@ -0,0 +1,9 @@ |
|||
# DTP Import Trace |
|||
|
|||
As a useful tool for diagnosing circular dependencies, you can enable log tracing of imports at runtime by editing [register.js](../register.js) and un-commenting: |
|||
|
|||
```js |
|||
// register("./es-import-trace.js", pathToFileURL("./")); |
|||
``` |
|||
|
|||
This will load the [es-import-trace.js](../es-import-trace.js) "loader" which prints the URL of the module being imported, then returns the result of the default loader. |
@ -0,0 +1,10 @@ |
|||
// es-import-trace.js
|
|||
// Copyright (C) 2025 DTP Technologies, LLC
|
|||
// All Rights Reserved
|
|||
|
|||
"use strict"; |
|||
|
|||
export const load = async (url, context, defaultLoad) => { |
|||
console.log("import: " + url); |
|||
return await defaultLoad(url, context); |
|||
}; |
Loading…
Reference in new issue