Exemple #1
0
        public override IProcessResult Process(string filePath, string content)
        {
            var    engine = _engineBuilder();
            string css    = engine.TransformToCss(content, filePath);

            string dir     = Path.GetDirectoryName(filePath);
            string appPath = string.Empty;

            if (!string.IsNullOrEmpty(dir))
            {
                appPath = pathTranslator.ResolveFileSystemPathToAppRelative(dir);
            }

            var dependencies = engine.GetImports().Select(importPath => {
                return(pathTranslator.ResolveAppRelativePathToFileSystem(Path.Combine(appPath, importPath)));
            });

            return(new ProcessResult(css, dependencies));
        }
 private static string GetWebPath(string outputPath, IPathTranslator pathTranslator)
 {
     return("/" + pathTranslator.ResolveFileSystemPathToAppRelative(Path.GetDirectoryName(outputPath)).TrimStart('/') + "/");
 }
 private static string GetWebPath(string outputPath, IPathTranslator pathTranslator)
 {
     return "/" + pathTranslator.ResolveFileSystemPathToAppRelative(Path.GetDirectoryName(outputPath)).TrimStart('/') + "/";
 }