示例#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)));
        }
示例#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);
        }
示例#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)));
        }
示例#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));
        }
示例#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);
 }
示例#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)));
        }