Skip to content

precompile partials with partials #1149

@forzatos

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?!

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