From 554b44fee01bd2f4b0cffb96a7bac2d142788dfe Mon Sep 17 00:00:00 2001 From: Sergey Chikuyonok Date: Thu, 19 Mar 2015 11:52:34 +0300 Subject: [PATCH] Minor improvements in rewrite config --- processor/rewrite-url.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/processor/rewrite-url.js b/processor/rewrite-url.js index 6e375ad..3a756c1 100644 --- a/processor/rewrite-url.js +++ b/processor/rewrite-url.js @@ -78,6 +78,7 @@ var defaultConfig = { * for example, it is possible to add cache-busting tokens */ staticMap: { + img: ['src'], script: ['src'], link: ['href'], video: ['src'], @@ -104,6 +105,10 @@ function createConfig(config) { if (config && config.rewriteMapAddon) { out.rewriteMap = extend({}, defaultConfig.rewriteMap, config.rewriteMapAddon); } + + if (config && config.staticMapAddon) { + out.staticMap = extend({}, defaultConfig.staticMap, config.staticMapAddon); + } return out; } @@ -252,4 +257,4 @@ module.exports = function(config) { module.exports.config = defaultConfig; module.exports.absoluteUrl = absoluteUrl; -module.exports.rebuildUrl = rebuildUrl; \ No newline at end of file +module.exports.rebuildUrl = rebuildUrl;