Skip to content

precompile partials with partials #1149

Description

@forzatos

Is there a way to precompile a partial that includes partials?

example:

<script>
{{precompile "application/templates/html/partial-one"}}
</script>

if partial-one.hbs includes something like this:

<div class="test">
   {{> application/templates/html/partial-test-one}}
   {{> application/templates/html/partial-test-two}}
</div>

the precompiled snippet will fail if i try to load data into it like this:

const template = Handlebars.templates['application/templates/html/partial-one'];
template(data);

It will complain about missing partial-test-one / partial-test-two.

All of this makes sense... But is there a way to force the precompile to also precompile all included child partials?

Maybe the easiest way is to create a new helper and register it or even extend existing one?!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions