Comments (5)
Ping. I'm getting the same thing, would be very happy to know how to replicate the '-f' output.
Thanks
from grunt-contrib-handlebars.
Did you have any luck resolving this? I'm having the same issue. Thanks!
from grunt-contrib-handlebars.
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.
@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.
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)
- Precompiled JST in <=IE9 HOT 2
- Partial's context is undefined
- Add support for Handlebars 3.x HOT 17
- Allow to specify Handlebars version HOT 1
- Add UMD support HOT 2
- How to add Custom Helpers HOT 2
- AMD requires 'handlebars' instead of just 'handlebars.runtime' HOT 1
- How to add runtime code to output file?
- handlebars with grunt HOT 1
- Update to Handlebars 4.*, precompiled templates not usable with latest bower version HOT 20
- Using commonjs:true generates incorrect JS code (0.10.2) HOT 2
- Declaring multiple AMD dependencies with a function
- 0.11? HOT 2
- Is "style" a keyword of grunt-contrib-handlebars
- options.separator gets normalized HOT 1
- Tests aren't passing with the current master branch HOT 1
- Can be this used from a file watcher?
- Still Maintained?
- Arbitrary Code Execution
- Does not return Template when Pre-Processing as a partial using AMD
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 grunt-contrib-handlebars.