示例#1
0
        public static string Minify(string fullFileName, string outputText, ProjectItem projectItem, MinifyType mode, string customArgument)
        {
            if (mode == MinifyType.Unspecified)
            {
                mode = Settings.Instance(fullFileName).DefaultJavaScriptMinifier;
            }

            switch (mode)
            {
            case MinifyType.gctAdvanced:
                return(ClosureCompilerEngine.Minify(fullFileName, outputText, projectItem, ClosureCompilerCompressMode.ADVANCED_OPTIMIZATIONS, customArgument));

            case MinifyType.gctSimple:
                return(ClosureCompilerEngine.Minify(fullFileName, outputText, projectItem, ClosureCompilerCompressMode.SIMPLE_OPTIMIZATIONS, customArgument));

            case MinifyType.gctWhiteSpaceOnly:
                return(ClosureCompilerEngine.Minify(fullFileName, outputText, projectItem, ClosureCompilerCompressMode.WHITESPACE_ONLY, customArgument));

            case MinifyType.msAjax:
                return(MsJsEngine.Minify(fullFileName, outputText, projectItem));

            case MinifyType.uglify:
                return(UglifyEngine.Minify(fullFileName, outputText, projectItem));

            case MinifyType.jsBeautifier:
                return(UglifyEngine.Beautify(outputText));

            default:
                return(YuiJsEngine.Minify(fullFileName, outputText, projectItem));
            }
        }
示例#2
0
文件: Chirp.cs 项目: cbilson/chirpy
        public void LoadActions()
        {
            if (this.engineManager == null || this.engineManager.IsDisposed) {
                this.engineManager = new EngineManager(this);
            }

            this.engineManager.Clear();
            this.engineManager.Add(YuiCssEngine = new YuiCssEngine());
            this.engineManager.Add(YuiJsEngine = new YuiJsEngine());
            this.engineManager.Add(DeanEdwardsPackerEngine = new DeanEdwardsPackerEngine());
            this.engineManager.Add(ClosureCompilerEngine = new ClosureCompilerEngine());
            this.engineManager.Add(LessEngine = new LessEngine());
            this.engineManager.Add(MsJsEngine = new MsJsEngine());
            this.engineManager.Add(MsCssEngine = new MsCssEngine());
            this.engineManager.Add(ConfigEngine = new ConfigEngine());
            this.engineManager.Add(ViewEngine = new ViewEngine());
            this.engineManager.Add(T4Engine = new T4Engine());
            this.engineManager.Add(CoffeeScriptEngine = new CoffeeScriptEngine());
            this.engineManager.Add(UglifyEngine = new UglifyEngine());
            this.engineManager.Add(JSHintEngine = new JSHintEngine());
            this.engineManager.Add(CSSLintEngine = new CSSLintEngine());
            this.engineManager.Add(SassEngine = new SassEngine());
        }