Skip to content

Commit

Permalink
fix(plugin): templateModule cache incorrect type
Browse files Browse the repository at this point in the history
  • Loading branch information
mkilpatrick committed Oct 17, 2023
1 parent 931e3cb commit 0d4460e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "../../../../common/src/template/internal/types.js";
import { ProjectStructure } from "../../../../common/src/project/structure.js";

const pathToModule = new Map();
const pathToModule = new Map<string, TemplateModule<any, any>>();

/**
* @returns an array of template modules matching the document's feature.
Expand All @@ -33,6 +33,7 @@ export const readTemplateModules = async (
let importedModule = pathToModule.get(path) as TemplateModule<any, any>;
if (!importedModule) {
importedModule = await import(path);
pathToModule.set(path, importedModule);
}

const templateModuleInternal = convertTemplateModuleToTemplateModuleInternal(
Expand All @@ -41,8 +42,6 @@ export const readTemplateModules = async (
true
);

pathToModule.set(path, templateModuleInternal);

return templateModuleInternal;
};

Expand Down

0 comments on commit 0d4460e

Please sign in to comment.