unfold / browserify-hogan Goto Github PK
View Code? Open in Web Editor NEWBrowserify transform plugin for Hogan.js templates
Browserify transform plugin for Hogan.js templates
Hey @sbrekken, could you add me as a maintainer on NPM too, so I can publish my update?
npm owner add callumlocke browserify-hogan
Hi - would you mind pushing the tags to this repository so that it can be pulled in by package management systems other than npm (eg. bower)?
I know that the current Hogan version on npm is still v2.0.0 but since v3.0.0 in the official repository passes all tests I'd like to use Hogan v3.x with browserify and this plugin as well.
@sbrekken do you mind if I make the following change to this transform: I want to change it so the compiled module exports the whole Hogan template object, not just the render function. So usage would change to:
var myTemplate = require('./my-template.mustache');
$('body').append( myTemplate.render({foo: 'bar'} );
^^^^^^
reasons:
render
method, not just a function)function (data) {return template.render(data)}
, so you have to go looking in the bundled code.I just wanted to check if you had any objection before I go ahead and do this, as it's effectively an API change (so I would bump the version to 0.1.0).
I use gulp-browserify in my build process and I seem to be getting errors when using this.
I require my template like so:
template: require('../Templates/invoiceDetail.ms'),
but when running gulp I get the following error:
/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/public/app/js/Templates/invoiceDetail.ms:1
<p>Hello</p>
^
ParseError: Unexpected token <
at wrapWithPluginError (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/index.js:44:10)
at Stream.<anonymous> (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/index.js:103:28)
at Stream.<anonymous> (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/index.js:299:22)
at Stream.EventEmitter.emit (events.js:117:20)
at Stream.onerror (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/node_modules/stream-combiner/index.js:29:18)
at Stream.EventEmitter.emit (events.js:117:20)
at Stream.<anonymous> (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/index.js:527:30)
at Stream.stream.write (/Users/bramdevries/Documents/School/2013-2014 3 Devine/Stage/Madewithlove/kaash/node_modules/gulp-browserify/node_modules/browserify/node_modules/through/index.js:26:11)
at Stream.ondata (stream.js:51:26)
at Stream.EventEmitter.emit (events.js:95:17)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.