Esempio n. 1
0
        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)));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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)));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 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);
 }
Esempio n. 6
0
		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)));
        }