12345678910111213141516171819 |
- var hbsfy = require("hbsfy");
- var concat = require("concat-stream");
- var assert = require("assert");
- var fs = require("fs");
- var templatePath = __dirname + "/custom_pre_compiler.hbs";
- // Subargs are just passed as the second argument
- // https://github.com/substack/node-browserify/blob/5cbf55a4397f300df69be574b59f3f30ac01b9c2/bin/advanced.txt#L81-L90
- fs.createReadStream(templatePath)
- .pipe(hbsfy(templatePath, { precompiler: "ember-template-compiler", precompilerOptions: false }))
- .pipe(concat(function(data) {
- assert(
- /hbsfy compiled Handlebars template/.test(data.toString()),
- "The template should be compiled"
- );
- }));
|