diff --git a/.travis.yml b/.travis.yml index cc4dba2..c39ba4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: node_js +before_script: + # Tests require that hbsfy is requireable by its name. We cannot use relative + # require calls because 'require("hbsfy/runtime");' will be compiled in to + # the browserify bundles. + - sudo npm link node_js: - "0.8" - "0.10" diff --git a/README.md b/README.md index e7d48d4..655dfc5 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [Handlebars][] precompiler plugin for [Browserify v2][] without magic. -Compiles Handlebars templates to plain Javascript. The compiled templates -depend only on [handlebars-runtime][] so they are lightweight and fast! +Compiles Handlebars templates to plain Javascript. The compiled templates only +have one copy of the Handlebars runtime so they are lightweight and fast! ## Usage @@ -13,7 +13,7 @@ Install hbsfy locally to your project: npm install hbsfy -Handlebars runtime will be automatically installed as [peer dependency][]. +Handlebars will be automatically installed as [peer dependency][]. Then use it as Browserify transform module with `-t`: @@ -38,7 +38,7 @@ To register custom helpers just require the runtime use and `registerHelper` to create helper: ```javascript -var Handlebars = require("handlebars-runtime"); +var Handlebars = require("hbsfy/runtime"); Handlebars.registerHelper("upcase", function(s) { return s.toUpperCase(); }); @@ -55,6 +55,16 @@ Handlebars.registerPartial('link', require("./partial.hbs")); Checkout the example folder for details. +## Changelog + +### 1.0.0 + + - Remove `handlebars-runtime` dependency and dependency directly on + `handlebars` module as [peer dependency][]. + - Runtime must be now required with `require("hbsfy/runtime")` instead of + `require("handlebars-runtime")`. + - Thanks to @kamicane for teaching me how to do this. + ## Browserify? @@ -63,5 +73,4 @@ Further reading: HELLO"); +}, 400); + diff --git a/test/test.js b/test/test.js index c7fec9b..028a163 100644 --- a/test/test.js +++ b/test/test.js @@ -3,8 +3,8 @@ var fs = require("fs"); var assert = require("assert"); -var hbsfy = require("../index"); -var Handlebars = require("handlebars-runtime"); +var hbsfy = require("hbsfy"); +var Handlebars = require("hbsfy/runtime"); Handlebars.registerHelper("upcase", function(s) { return s.toUpperCase();