templatizer
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -34,3 +34,3 @@ var esprima = require('esprima'); | ||
// check for single string push | ||
if (i === 3 && node.type === "ExpressionStatement" && node.expression.callee.object.name === "buf" && | ||
if (i === 3 && node.type === "ExpressionStatement" && node.expression.callee && node.expression.callee.object.name === "buf" && | ||
node.expression.arguments.length === 1 && node.expression.arguments[0].type === "Literal") { | ||
@@ -37,0 +37,0 @@ // save the simple string |
{ | ||
"name": "templatizer", | ||
"description": "Simple solution for compiling jade templates into vanilla JS functions for blazin' fast client-side use.", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -22,3 +22,3 @@ "bin": "./bin/cli", | ||
"falafel": "^0.3.1", | ||
"jade": "^1.5.0", | ||
"jade": "^1.7.0", | ||
"minimist": "^0.1.0", | ||
@@ -35,4 +35,4 @@ "uglify-js": "^2.4.0", | ||
"phantomjs": "^1.9.7-15", | ||
"precommit-hook": "^0.4.1", | ||
"testee": "0.0.13", | ||
"precommit-hook": "^1.0.7", | ||
"testee": "^0.1.1", | ||
"yetify": "0.1.0" | ||
@@ -39,0 +39,0 @@ }, |
@@ -84,2 +84,6 @@ # templatizer.js | ||
#### `dontRemoveMixins` (boolean, default false) | ||
By default `jade` will not compile any mixins which aren't being called from the file they were created in. This is usually a very good thing, since keeps file sizes down. But in some cases (especially when using the [mixin support](#mixin-support) functionality), you may want to create mixins and call them from other places in your code or other files. Setting this option to `true` will keep all mixins in the compiled source. | ||
#### `jade` (object, default `{}`) | ||
@@ -86,0 +90,0 @@ |
@@ -8,2 +8,3 @@ var jade = require('jade'); | ||
var path = require('path'); | ||
var util = require('util'); | ||
var _ = require('underscore'); | ||
@@ -15,2 +16,9 @@ var fs = require('fs'); | ||
// Setting dynamicMixins to true will result in | ||
// all mixins being written to the file | ||
function DynamicMixinsCompiler () { | ||
jade.Compiler.apply(this, arguments); | ||
this.dynamicMixins = true; | ||
} | ||
util.inherits(DynamicMixinsCompiler, jade.Compiler); | ||
@@ -24,2 +32,3 @@ module.exports = function (templateDirectories, outputFile, options) { | ||
dontTransformMixins: false, | ||
dontRemoveMixins: false, | ||
jade: {}, | ||
@@ -110,2 +119,6 @@ namespace: '' // No namespace means 'window' | ||
if (options.dontRemoveMixins) { | ||
jadeCompileOptions.compiler = DynamicMixinsCompiler; | ||
} | ||
jadeCompileOptions.filename = item; | ||
@@ -112,0 +125,0 @@ var template = beautify(jade.compileClient(fs.readFileSync(item, 'utf-8'), jadeCompileOptions).toString()); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28113
551
155
Updatedjade@^1.7.0