public override IProcessResult Process(string filePath, string content)
        {
            var compiler = new SassCompiler("");
            var sassMode = IsSass.IsMatch(filePath) ? SassCompiler.SassMode.Sass : SassCompiler.SassMode.Scss;

            return(new ProcessResult(compiler.CompileSass(content, sassMode)));
        }
        public override IProcessResult Process(string filePath, string content)
        {
            var cacheKey = "SASSCACHE-" + filePath;

            string result;
            var cache = new BundleCache();

            if (_cacheEnabled)
            {
                result = cache.GetContent(cacheKey);

                if (result != null) return new ProcessResult(result, GetImportDependencies(filePath, content));
            }

            var dependencies = GetImportDependencies(filePath, content);
            var compiler = new SassCompiler("");
            var sassMode = IsSass.IsMatch(filePath) ? SassCompiler.SassMode.Sass : SassCompiler.SassMode.Scss;

            result = compiler.CompileSass(content, sassMode);

            if (_cacheEnabled)
            {
                var dependentPaths = new List<string>(dependencies);
                dependentPaths.Add(filePath);

                cache.Add(cacheKey, result, dependentPaths);
            }

            return new ProcessResult(result, dependencies);
        }
        public override IProcessResult Process(string filePath, string content)
        {
            var compiler = new SassCompiler();
            var sassMode = IsSass.IsMatch(filePath) ? SassCompiler.SassMode.Sass : SassCompiler.SassMode.Scss;

            return(new ProcessResult(compiler.CompileSass(content, sassMode, Path.GetDirectoryName(filePath), _precision)));
        }
        public string Process(string filePath, string content)
        {
            var compiler = new SassCompiler("");
            var sassMode = isSass.IsMatch(filePath) ? SassCompiler.SassMode.Sass : SassCompiler.SassMode.Scss;

            return(compiler.CompileSass(content, sassMode));
        }
Exemple #5
0
 public override string Process(string filePath, string content)
 {
     var compiler = new SassCompiler("");
     var sassMode = IsSass.IsMatch(filePath) ? SassCompiler.SassMode.Sass : SassCompiler.SassMode.Scss;
     return compiler.CompileSass(content, sassMode);
 }
		public override IProcessResult Process(string filePath, string content)
        {
            var compiler = new SassCompiler("");
            var sassMode = IsSass.IsMatch(filePath) ? SassCompiler.SassMode.Sass : SassCompiler.SassMode.Scss;
            return new ProcessResult(compiler.CompileSass(content, sassMode, Path.GetDirectoryName(filePath)));
        }