Skip to content

Support templates written as ES modules#207

Draft
tlangens wants to merge 1 commit intomasterfrom
tlangens.esm
Draft

Support templates written as ES modules#207
tlangens wants to merge 1 commit intomasterfrom
tlangens.esm

Conversation

@tlangens
Copy link
Contributor

No description provided.

return callback(null, templateBody);
}

try { templateBody = require(path.resolve(templatePath)); }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This require here means templates with top-level await won't work, which does limit the usefulness of this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might work with import(), but it would make the function async. In case someone wants to continue this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants