templatizer
Advanced tools
Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "templatizer", | ||
"description": "Simple solution for compiling jade templates into vanilla JS functions for blazin' fast client-side use.", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -25,2 +25,3 @@ "bin": "./bin/cli", | ||
"lodash": "^3.2.0", | ||
"minimatch": "^2.0.7", | ||
"minimist": "^0.1.0", | ||
@@ -27,0 +28,0 @@ "uglify-js": "^2.4.0", |
@@ -123,2 +123,6 @@ # templatizer.js | ||
#### `globOptions` (object, default `{}`) | ||
`globOptions` will be passed directly to `node-glob`. See the [API docs](https://github.com/isaacs/node-glob#options) for available options. | ||
### Mixin Support | ||
@@ -125,0 +129,0 @@ |
@@ -15,2 +15,3 @@ var jade = require('jade'); | ||
var glob = require('glob'); | ||
var minimatch = require("minimatch"); | ||
@@ -35,2 +36,3 @@ // Setting dynamicMixins to true will result in | ||
inlineJadeRuntime: true, | ||
globOptions: {}, | ||
jade: {}, | ||
@@ -40,4 +42,5 @@ namespace: '' // No namespace means 'window' | ||
if (typeof templateDirectories === "string") { | ||
templateDirectories = glob.sync(templateDirectories); | ||
templateDirectories = glob.sync(templateDirectories, options.globOptions); | ||
} | ||
@@ -51,3 +54,3 @@ | ||
amdDependencies = options.amdDependencies.toString(); | ||
} | ||
} | ||
@@ -106,2 +109,13 @@ var namespace = _.isString(options.namespace) ? options.namespace : ''; | ||
} | ||
// Skip files not matching the initial globbing pattern | ||
if(options.globOptions.ignore) { | ||
var match = function (ignorePattern) { | ||
return minimatch(file, ignorePattern); | ||
}; | ||
if(options.globOptions.ignore.some(match)) { | ||
return; | ||
} | ||
} | ||
if (path.extname(item) === '' && path.basename(item).charAt(0) !== '.') { | ||
@@ -175,3 +189,3 @@ if (folders.indexOf(item) === -1) folders.push(item); | ||
wrappedJade = ''; | ||
var indentOutput = output.split('\n').map(function (l) { return l ? ' ' + l : l; }).join('\n'); | ||
@@ -178,0 +192,0 @@ var finalOutput = outputTemplate |
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
31715
614
179
10
+ Addedminimatch@^2.0.7