示例#1
0
        private async static Task MinifyFile(IContentType contentType, string sourcePath, string minPath, IMinifierSettings settings, bool compilerNeedsSourceMap = true)
        {
            IFileMinifier minifier = Mef.GetImport <IFileMinifier>(contentType);
            bool          changed  = await minifier.MinifyFile(sourcePath, minPath, compilerNeedsSourceMap);

            if (settings.GzipMinifiedFiles && (changed || !File.Exists(minPath + ".gzip")))
            {
                FileHelpers.GzipFile(minPath);
            }
        }
        private static void MinifyFile(IContentType contentType, string sourcePath, string minPath, IMinifierSettings settings)
        {
            IFileMinifier minifier = Mef.GetImport <IFileMinifier>(contentType);
            bool          changed  = minifier.MinifyFile(sourcePath, minPath);

            if (settings.GzipMinifiedFiles && (changed || !File.Exists(minPath + ".gzip")))
            {
                FileHelpers.GzipFile(minPath);
            }
        }