fis-parser-sass
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -22,2 +22,11 @@ /** | ||
function isEmpty(obj) { | ||
if (obj) { | ||
for (var key in obj) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
// 匹配scss内嵌代码:@import 'xxx'; | ||
@@ -212,4 +221,15 @@ // @import 'xxx', 'xxx'; | ||
var after = compile.after = function( content, currentFile, paths ) { | ||
return content; | ||
var after = compile.after = function( content, file, paths ) { | ||
// 处理,解决资源引用路径问题。 | ||
content = fis.compile.extCss(content); | ||
return content.replace(fis.compile.lang.reg, function(all, type, value) { | ||
var info = fis.uri(value, file.dirname); | ||
if (info.file) { | ||
value = info.quote + info.file.subpath + info.query + info.quote; | ||
} | ||
return value; | ||
}); | ||
}; |
@@ -22,2 +22,5 @@ /* | ||
opts.include_paths = opts.include_paths.map(function( dir ) { | ||
if (dir[0] !== '/') { | ||
dir = path.join(root, dir); | ||
} | ||
return path.resolve( dir ); | ||
@@ -24,0 +27,0 @@ }); |
{ | ||
"name" : "fis-parser-sass", | ||
"description" : "A parser plugin for fis to compile sass file.", | ||
"version" : "0.2.1", | ||
"version" : "0.2.2", | ||
"author" : "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage" : "http://fis.baidu.com/", |
10401
202