Skip to content

Commit 3ff5247

Browse files
committed
Revert back to require for use in templates
1 parent 78b813d commit 3ff5247

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/templates-worker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ export class TemplatesWorker {
7474
);
7575
};
7676

77-
requireFnFromTemplate = async (packageOrPath: string) => {
77+
requireFnFromTemplate = (packageOrPath: string) => {
7878
const isPath =
7979
packageOrPath.startsWith("./") || packageOrPath.startsWith("../");
8080

8181
if (isPath) {
82-
return await import(
82+
return require(
8383
path.resolve(
8484
this.config.templatePaths.custom ||
8585
this.config.templatePaths.original,
8686
packageOrPath,
87-
)
87+
),
8888
);
8989
}
9090

91-
return await import(packageOrPath);
91+
return require(packageOrPath);
9292
};
9393

9494
getTemplate = (name: string, fileName: string, path?: string) => {

0 commit comments

Comments
 (0)