-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
Accessing the graph constructed in the loader here
deno-js-loader/src/rs_lib/lib.rs
Line 318 in 68a5ebe
| graph: ModuleGraph, |
For now we need to do:
const workspace = new Workspace({
cachedOnly: true,
preserveJsx: true,
noTranspile: true,
configPath: configPath,
});
console.time("create_loader");
const loader = await workspace.createLoader({
entrypoints: [config.entrypoint.href, ...bootstrapModules],
});
console.timeEnd("create_loader");
const cache = createCache();
console.time("create_graph");
const graph = await createGraph(
[config.entrypoint.href, ...bootstrapModules],
{
kind: "codeOnly",
load: cache.load,
cacheInfo: cache.cacheInfo,
resolve: (s, r) => {
try {
try {
return loader.resolve(s, r, ResolutionMode.Import);
} catch {
return loader.resolve(s, r, ResolutionMode.Require);
}
} catch (error) {
console.log(`Unable to resolve: ${s} from ${r}`);
throw error;
}
},
},
);
console.timeEnd("create_graph");which is redundant work.
Metadata
Metadata
Assignees
Labels
No labels