fis-kernel
Advanced tools
Comparing version 2.0.15 to 2.0.16
@@ -92,4 +92,5 @@ /* | ||
} catch (e){ | ||
// require.resolve 可能报错,不能中断程序 | ||
// fis.log.error('load plugin [' + pluginName + '] config error : ' + e.message); | ||
if (e.code !== 'MODULE_NOT_FOUND') { | ||
throw e; | ||
} | ||
} | ||
@@ -96,0 +97,0 @@ } |
@@ -266,2 +266,21 @@ /* | ||
}); | ||
if (tag == 'img') { | ||
//<img src="image-src.png" srcset="image-1x.png 1x, image-2x.png 2x, image-3x.png 3x, image-4x.png 4x"> | ||
//http://www.webkit.org/demos/srcset/ | ||
m = m.replace(/(\ssrcset\s*=\s*)('[^']+'|"[^"]+"|[^\s\/>]+)/ig, function(m, prefix, value){ | ||
var info = fis.util.stringQuote(value); | ||
var set = info.rest.split(','); | ||
var imgset = []; | ||
set.forEach(function (item) { | ||
item = item.trim(); | ||
var p = item.indexOf(' '); | ||
if (p == -1) { | ||
imgset.push(item); | ||
return; | ||
} | ||
imgset.push(map['uri']['ld'] + item.substr(0, p) + map['uri']['rd'] + item.substr(p)); | ||
}); | ||
return prefix + info.quote + imgset.join(', ') + info.quote; | ||
}); | ||
} | ||
} | ||
@@ -268,0 +287,0 @@ } else if($6){ |
@@ -90,5 +90,7 @@ /* | ||
} | ||
if(file && fis.util.isFile(file)){ | ||
var root = fis.project.getProjectPath(); | ||
if(file && fis.util.isFile(file) && file.indexOf(root) === 0){ | ||
info.file = fis.file(file); | ||
} | ||
} | ||
} | ||
@@ -95,0 +97,0 @@ } |
{ | ||
"name": "fis-kernel", | ||
"description": "fis kernel.", | ||
"version": "2.0.15", | ||
"version": "2.0.16", | ||
"author": "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage": "http://fis.baidu.com/", |
80427
2406