Coder Social home page Coder Social logo

Comments (5)

alexlafroscia avatar alexlafroscia commented on June 8, 2024

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.

Chris2011 avatar Chris2011 commented on June 8, 2024

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.

alexlafroscia avatar alexlafroscia commented on June 8, 2024

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.

Chris2011 avatar Chris2011 commented on June 8, 2024

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.

Chris2011 avatar Chris2011 commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.