Keeping a widget template in a separate file

Trying to migrate from the Hogan templates to html tagged template literal templates.

Upgrading InstantSearch.js | Algolia.

The template is huge, hence I want to move it into a separate file. Is it true that the only option is to move the whole template function into a separate JS file and import it into the JS file which contains instant search configuration code? I’m using bundler (Parcel).