Ejemplo n.º 1
0
		content = content.replace(urlRegex, function(match, first, second) {
			pathAdjust = path.relative(rootDir, path.dirname(filePath));
			if(pathAdjust) {
				pathAdjust += '/';
			}
			adjustedPath = self._toUnixSep(path.normalize(pathAdjust + second));
			if(urlTransformFunction && !styleExtRegex.test(adjustedPath)) {
				adjustedPath = urlTransformFunction(adjustedPath, rootDir);
			}
			return first + 'url("' + adjustedPath + '")';
		});
Ejemplo n.º 2
0
		content = content.replace(urlRegex, function (match, first, second) {
			pathAdjust = path.relative(rootDir, path.dirname(filePath));
			if (pathAdjust) {
				pathAdjust += '/';
			}
			newURL = self._toUnixSep(path.normalize(pathAdjust + second));
			
			if (!styleExtRegex.test(newURL)) {
				rootDir = pathManager.toUnixSep(rootDir);
				newURL = pathManager.pathToURL(rootDir + '/' + newURL);
				newURL = pathManager.toUnixSep(path.normalize(newURL));
				
				if (urlTransformFunction) {
					newURL = urlTransformFunction(newURL);
				}
			}
			return first + 'url("' + newURL + '")';
		});