Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pass options along to fileify

  • Loading branch information...
commit 140dfe3b63734c28af382bb5844897b511dd890d 1 parent fb8dfd3
@substack authored
Showing with 12 additions and 5 deletions.
  1. +1 −1  example/simple/server.js
  2. +9 −2 index.js
  3. +2 −2 package.json
View
2  example/simple/server.js
@@ -12,7 +12,7 @@ var browserify = require('browserify');
var jadeify = require('jadeify');
util.print('Generating bundle... ');
-var bundle = browserify().use(jadeify(__dirname + '/views'));
+var bundle = browserify().use(jadeify(__dirname + '/views', { watch : true }));
bundle.addEntry(__dirname + '/static/main.js');
app.use(bundle);
console.log('done');
View
11 index.js
@@ -15,7 +15,14 @@ module.exports = function (opts, ext) {
if (typeof opts === 'string') {
opts = { views : opts };
}
- if (ext) opts.ext = ext;
+ if (ext && typeof ext === 'string') {
+ opts.ext = ext;
+ }
+ else if (typeof ext === 'object') {
+ Object.keys(ext).forEach(function (key) {
+ opts[key] = ext[key];
+ });
+ }
var viewdirs = [ './views' ];
@@ -44,7 +51,7 @@ module.exports = function (opts, ext) {
});
bundle.require({ jquery : 'jquery-browserify' });
- bundle.use(fileify('jadeify/views/index.js', viewdir, opts.ext));
+ bundle.use(fileify('jadeify/views/index.js', viewdir, opts));
Object.keys(bundle.files).forEach(function (key) {
var file = bundle.files[key];
View
4 package.json
@@ -1,6 +1,6 @@
{
"name" : "jadeify",
- "version" : "0.3.0",
+ "version" : "0.3.1",
"description" : "Browserify middleware to render jade templates browser-side",
"main" : "index.js",
"directories" : {
@@ -9,7 +9,7 @@
},
"browserify" : "empty.js",
"dependencies" : {
- "fileify" : "0.2.x",
+ "fileify" : "0.3.x",
"jade" : "0.11.x",
"traverse" : ">=0.3.5 <0.4",
"deck" : "0.0.x",
Please sign in to comment.
Something went wrong with that request. Please try again.