Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompiled templates cannot be imported #1254

Closed
lukgreen opened this issue Sep 26, 2016 · 1 comment
Closed

Precompiled templates cannot be imported #1254

lukgreen opened this issue Sep 26, 2016 · 1 comment

Comments

@lukgreen
Copy link

I precompile templates with the command:
handlebars -m -e html ./templates/ > ./templates/templates.js
Then I try to import the resulting file in my javascript:
import './templates/templates.js';
Which throws an error:
Uncaught ReferenceError: Handlebars is not defined
This error appears with either full or run-time only Handlebars included. I use Handlebars 4.0.5 and bundle a project with Webpack.
Can you help with this please?

@nknapp
Copy link
Collaborator

nknapp commented Feb 24, 2017

The precompiler does not create any module-code. If you are using webpack, you should probably consider using the handlebars-loader or something similar.

(I have not tried the loader yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants