【发布时间】:2015-06-07 16:52:42
【问题描述】:
我正在使用在本地机器上运行的 Closure Compiler 来生成客户端文件。我还使用http://closure-compiler.appspot.com/home 的在线关闭工具来检查我的工作:我粘贴我的 JavaScript 代码,按编译,如果有警告,编译器会向我显示带有实际行和行号的警告。
我想知道是否可以使用本地版本的 Closure Compiler 获得相同的输出。这是我用来编译文件并获取已编译 JavaScript 的代码,但这次,我想要警告:
System.IO.File.WriteAllText(FileNameInput, TheJS);
string JavaArgument = "-jar ClosureCompiler/compiler.jar --js ClosureCompiler/initial" + FileNameSuffix + ".js --js_output_file ClosureCompiler/compiled" + FileNameSuffix + ".js --compilation_level ADVANCED_OPTIMIZATIONS --externs ExternalFiles/JqueryExtern.js";
System.Diagnostics.Process clientProcess = new System.Diagnostics.Process();
clientProcess.StartInfo.FileName = "java.exe";
clientProcess.StartInfo.Arguments = JavaArgument;
clientProcess.StartInfo.CreateNoWindow = true;
clientProcess.StartInfo.UseShellExecute = false;
clientProcess.StartInfo.WorkingDirectory = HttpRuntime.AppDomainAppPath;
clientProcess.Start();
clientProcess.WaitForExit();
string TheOutputScript = System.IO.File.ReadAllText(FileNameOutput);
我需要改变什么?
【问题讨论】:
标签: c# asp.net google-closure-compiler