Giter Club home page Giter Club logo

Comments (5)

Chuwiey avatar Chuwiey commented on June 3, 2024

Ping. I'm getting the same thing, would be very happy to know how to replicate the '-f' output.

Thanks

from grunt-contrib-handlebars.

mattmenefee avatar mattmenefee commented on June 3, 2024

Did you have any luck resolving this? I'm having the same issue. Thanks!

from grunt-contrib-handlebars.

billev2k avatar billev2k commented on June 3, 2024

This is because the grunt plugin does NOT run the command line handlebars tool. Nor does it use the command line tool's option handling, nor output production. Rather, it runs the compiler on each input file, wraps its own boilerplate around each compiled output, and concatenates them together. Possibly with some additional bracketing boilerplate, for amd, etc.

from grunt-contrib-handlebars.

jamesplease avatar jamesplease commented on June 3, 2024

@billev2k is right; the default output from the CLI puts the templates in the Handlebars.templates array, but this task doesn't use the CLI command nor mimic it. The output from this task is more similar to passing the -s flag from the CLI, then working with the value of main in the produced JSON.

Right now there's no direct way to mimic the output of the -f flag. If you wanted to store it in the templates array, you could use the processContent option. Something like this might work if you're building a single template per target (note: I didn't test this, and it's probably not suited for production; it's just a quick example to get the idea across):

processContent: function(content, filepath) {
  return 'handlebars.templates[filepath] = ' + content;
}

from grunt-contrib-handlebars.

atuttle avatar atuttle commented on June 3, 2024

For anyone else that finds this bug when dealing with the same issue (as I did), you may find that patrickkettner/grunt-compile-handlebars suits your needs better than this repo. It works well for me.

from grunt-contrib-handlebars.

Related Issues (20)

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.