-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement vite with handlebars #28
Labels
question
Further information is requested
Comments
How exactly would you want to use the templates in Laravel? The Vituum plugin compiles the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This project looks like what I need. I am building a site with Laravel, but would like to use handlebars templates and an api to make the pages dynamic.
I would like to have vite precompile my templates. Because this is a laravel project, all my files are located under /resources, and I have a /public folder as well. With webpack you would have the input be in resources, and the output saved in public.
I've installed vituum and @vituum/vite-plugin-handlebars packages with npm, here is my package.json
And here is my vite.config.js
As you can see I have a hbs file
resources/handlebars/pages/portfolio/test.hbs
that contains a simple template:Then in the page where I intend to use the template I have :
The output when I am running
npm run dev
is:After this is where I get lost. How do I get the template to be usable in my JavaScript? Is this library capable of what I want, where I can have a directory with say 10 templates, each getting precompiled, and be able to use them within my js?
In theory, they would get compiled for testing, and then in my deployment script (using a github action) I would compile them on my production environment, so the compiled templates arent stored in git.
Any help is appreciated. Thanks,
The text was updated successfully, but these errors were encountered: