Closed mohd-akram closed 9 months ago
Nice work, I had this on my backlog too. But we won't merge this in 4.x
in order to keep it backwards-compatible. Please target the PR at the master
-branch.
Yes, I hoped it could be done in 4.x
but reached the same conclusion. Will be retargeting and adjusting the PR - it needs some changes most likely - but need to merge the CI and build PRs first.
Rebased on master, but closing for now as it depends on updating the build system, as well as fixing @handlebars/parser
's exports (it does not properly provide ESM support as it is missing an exports
field in its package.json) for integration tests to pass.
This allows importing the library directly from an ESM, without requiring a build step. One change was required for a test to pass in
index.runtime.js
- a copy of the runtime module object is made to allow overridingcheckRevision
(ESMs don't allow modifying import objects). Thesource-map
module is replaced via subpath imports rather than via runtime checking sincerequire
is not available in a ESM.Before creating a pull-request, please check https://github.com/handlebars-lang/handlebars.js/blob/master/CONTRIBUTING.md first.
Generally we like to see pull requests that
4.x
-branch contains the latest version. Please target that branch in the PR.