Пример #1
0
        public void Process(BundleContext context, BundleResponse response)
        {
            response.ContentType = "text/javascript";
            response.Content     = string.Empty;

            foreach (var fileInfo in response.Files)
            {
                if (fileInfo.Extension.Equals(".coffee", StringComparison.Ordinal))
                {
                    response.Content += TransformCache.Get(fileInfo, () => _Engine.Compile(File.ReadAllText(fileInfo.FullName)));
                }
                else if (fileInfo.Extension.Equals(".js", StringComparison.Ordinal))
                {
                    response.Content += TransformCache.Get(fileInfo, () => File.ReadAllText(fileInfo.FullName));
                }
            }
        }
Пример #2
0
        public void Process(BundleContext context, BundleResponse response)
        {
            response.ContentType = "text/css";
            response.Content     = string.Empty;

            foreach (var fileInfo in response.Files)
            {
                if (fileInfo.Extension.Equals(".sass", StringComparison.Ordinal) || fileInfo.Extension.Equals(".scss", StringComparison.Ordinal))
                {
                    response.Content += TransformCache.Get(fileInfo, () => _Engine.Compile(fileInfo.FullName, false, new List <string>()));
                }
                else if (fileInfo.Extension.Equals(".css", StringComparison.Ordinal))
                {
                    response.Content += TransformCache.Get(fileInfo, () => File.ReadAllText(fileInfo.FullName));
                }
            }
        }