eta icon indicating copy to clipboard operation
eta copied to clipboard

feat: expose resolvePath to templates

Open aranor01 opened this issue 8 months ago • 1 comments

This PR adds resolvePath to transform relative paths into absolute ones. A use case for this is dynamic import, e.g.:

<% let utils = await import (resolvePath("./include/utils.mjs")) %>

The lack of this feature can be worked around by exposing Eta.resolvePath via it. However, if used in a partial, the base path used to resolve the relative path would always be the directory of the including (root) template, which could lead to confusion.

aranor01 avatar Mar 09 '25 20:03 aranor01