Comparing version 0.4.5 to 0.4.6
{ | ||
"name": "more-css", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "a css pre-compiler & agressive compressor", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -61,2 +61,6 @@ ##A css pre-compiler by javascript | ||
more.less(l:Boolean):Boolean | ||
是否兼容less的相对路径。在uri标准中,'/uri'为相对根路径,'uri'和'./uri'均为相对当前路径,兼容less为仅后者为当前路径,前2为相对根。此设置会干扰@import和构建。 | ||
more.suffix(s:String):String | ||
@@ -63,0 +67,0 @@ |
@@ -462,10 +462,23 @@ define(function(require, exports) { | ||
impts.forEach(function(impt) { | ||
if(impt.charAt(0) == '/') { | ||
if(!root) { | ||
throw new Error('����@import����Ը�·���ļ���Ҫ��������root:\n' + file + ' -> ' + impt); | ||
if(less) { | ||
if(impt.charAt(0) == '.') { | ||
impt = cur + impt.replace(/\w+\/\.\.\\/g, '').replace(/\.\//g, ''); | ||
} | ||
impt = root.replace(/[/\\]$/, '') + impt; | ||
else { | ||
if(!root) { | ||
throw new Error('����@import����Ը�·���ļ���Ҫ��������root:\n' + file + ' -> ' + impt); | ||
} | ||
impt = root.replace(/[/\\]$/, '') + '/' + impt.replace(/^[/\\]/, ''); | ||
} | ||
} | ||
else { | ||
impt = cur + impt.replace(/\w+\/\.\.\\/g, '').replace(/\.\//g, ''); | ||
if(impt.charAt(0) == '/') { | ||
if(!root) { | ||
throw new Error('����@import����Ը�·���ļ���Ҫ��������root:\n' + file + ' -> ' + impt); | ||
} | ||
impt = root.replace(/[/\\]$/, '') + impt; | ||
} | ||
else { | ||
impt = cur + impt.replace(/\w+\/\.\.\\/g, '').replace(/\.\//g, ''); | ||
} | ||
} | ||
@@ -472,0 +485,0 @@ var trace = ''; |
419088
9696
75