From e9cdc6dec809f0638094319de4a371512a1a495f Mon Sep 17 00:00:00 2001 From: Cory Taylor Date: Sun, 6 Apr 2014 01:12:19 -0400 Subject: [PATCH 1/2] added ability to specify jade compile options --- src/config.js | 10 ++++++++-- src/index.js | 6 ++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/config.js b/src/config.js index 3bf2edd..f09e128 100644 --- a/src/config.js +++ b/src/config.js @@ -3,7 +3,10 @@ exports.defaults = function() { return { jade: { - extensions: [ "jade" ] + extensions: [ "jade" ], + compileOptions: { + compileDebug: false + } } }; }; @@ -12,13 +15,16 @@ exports.placeholder = function() { return "\t\n\n" + " jade: # config settings for the Jade compiler module\n" + " lib: undefined # use this property to provide a specific version of Jade\n" + - " extensions: [\"jade\"] # default extensions for Jade files\n"; + " extensions: [\"jade\"] # default extensions for Jade files\n" + + " compileOptions: #default jade compile options\n" + + " compileDebug: false\n"; }; exports.validate = function( config, validators ) { var errors = []; if ( validators.ifExistsIsObject( errors, "jade config", config.jade ) ) { + validators.ifExistsIsObject( errors, "jade compileOptions", config.jade.compileOptions ) if ( !config.jade.lib ) { config.jade.lib = require( "jade" ); diff --git a/src/index.js b/src/index.js index 6ae1a82..277fbce 100644 --- a/src/index.js +++ b/src/index.js @@ -34,10 +34,8 @@ var compile = function ( mimosaConfig, file, cb ) { var error, output; try { - var opts = { - compileDebug: false, - filename: file.inputFileName - }; + var opts = mimosaConfig.jade.compileOptions; + opts.filename = file.inputFileName; output = mimosaConfig.jade.lib.compileClient( file.inputFileText, opts); } catch ( err ) { From 352fef2e3db83225e4110ec4483caa545f0a7075 Mon Sep 17 00:00:00 2001 From: Cory Taylor Date: Sun, 6 Apr 2014 14:42:16 -0400 Subject: [PATCH 2/2] updated README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 906ab9b..75d2bae 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,10 @@ This module utilizes all of the built-in template behavior that comes with Mimos jade: lib: undefined extensions: [ "jade" ] + compileOptions: + compileDebug: false ``` * `lib`: You may want to use this module but may not be ready to use the latest version of Jade. Using the `lib` property you can provide a specific version of Jade if the one being used by this module isn't to your liking. To provide a specific version, you must have it `npm install`ed into your project and then provide it to `lib`. For instance: `lib: require('jade')`. To use a version of jade prior to `1.0`, use mimosa-jade `1.0.1`. * `extensions`: an array of strings, the extensions of your Jade files. +* `compileOptions`: an object to be passed to `jade.compile`. \ No newline at end of file