browserify-cache
Advanced tools
Comparing version 0.2.0 to 0.2.1
var dumb = function() {}; | ||
const secondsInYear = 365 * 24 * 60 * 60; //const is the new, cool thing | ||
module.exports = function(browserifyOpts, browserifyMiddleware) { | ||
if(browserifyOpts.mount == null) | ||
browserifyOpts.mount = '/browserify.js'; //Use browserify default mount path | ||
return function(req, res, next) { | ||
@@ -5,0 +7,0 @@ //Pass a fake request through browserify so that we can update the bundle if it has changed |
@@ -5,3 +5,3 @@ { | ||
"description": "Easily cache Browserify bundles", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -12,2 +12,3 @@ browserify-cache - Strong and weak caching for Browserify bundles | ||
https://github.com/substack/node-browserify | ||
http://code.google.com/speed/page-speed/docs/caching.html | ||
@@ -18,2 +19,5 @@ | ||
```javascript | ||
//Create Express app and config... | ||
//Setup browserify | ||
var browserify = require('browserify'); | ||
@@ -25,3 +29,3 @@ var browserifyCache = require('browserify-cache'); | ||
//Now you can expose this URL to your views using Express | ||
app.dynamicHelpers({ | ||
app.helpers({ | ||
'browserifyMount': function() { | ||
@@ -28,0 +32,0 @@ return config.browserify.mount + '.' + browserifyMiddleware.modified.getTime() + '.js'; |
33
3162
3
35