Comments (5)
I've been looking into this, and I don't think it's possible. Rollup doesn't seem to support changing the id
for a file while transforming it, and a bunch of logic within Vite seems to require the .html
extension for the entry file.
I can successfully get the .hbs
file at the top level through the Handlebars transform, but something within Vite (or maybe Rollup?) chokes on it after that; presumably because it's getting the wrong extension.
from vite-plugin-handlebars.
I now run in this problem :D. Of course I can fix it with changeing hbs from html but as you already said, it would be cool. Beside that, I didn't believe that this is possible, I googled just short and I found this: https://github.com/yohangz/rollup-plugin-hbs Could this be a solution?
from vite-plugin-handlebars.
Unfortunately, I don't think it is. That plugin defines a transform
hook, which this plugin currently does not do, but certainly could!
I took a stab at implementing one to see if that would do the trick last week, but unfortunately it did not because I can't change the .hbs
file extension to .html
through the transform, and Vite is expecting that the "entry file" is an .html
file (it's hard-coded in their code in some places that I've seen while looking through how Vite actually "works" under-the-hood).
It could be an issue worth raising on the Vite repo to see if we could somehow find a solution to this, though!
from vite-plugin-handlebars.
Maybe there could be a ticket created for hbs. I dunno whether there is a ticket yet. I googled a couple of days ago and all what I found was the rollup hbs plugin. @jdf221 thx for investigating :).
from vite-plugin-handlebars.
I saw the discussion in the vite repo. Is there anything new here? Do you think, your code is ready for a PR @jdf221 ?
from vite-plugin-handlebars.
Related Issues (19)
- Avoid error when partial directory is configured, but does not exist
- pagePath not properly resolved?
- feature request: ability to import as precompiled templates
- [Security] Workflow ci.yml is using vulnerable action actions/checkout
- [Security] Workflow ci.yml is using vulnerable action actions/checkout
- Using with TailwindCSS - partials do not refresh when editting tailwind classes HOT 1
- Watch partial files for changes HOT 5
- wrong path in dist when the public folder is used
- Upgrade to vite3, wrong type. HOT 4
- Reloading not happening when partial changes (windows 10) HOT 2
- Partials only work on index.html HOT 1
- Upgrade to support Vite 5 HOT 3
- Vite v5 warnings HOT 1
- Support multiple partial directories HOT 11
- Make PR to Awesome Vite
- Changes in linked dependencies don't cause hmr HOT 14
- Support relative links to assets from partials
- Nested Partials are Not Found HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-handlebars.