eclipse - 将 Google 闭包编译器与 Eclipse IDE 集成?

标签 eclipse minify google-closure-compiler

有人知道如何集成Google closure compiler使用 Eclipse IDE?我想做的事情是将 Google 闭包编译器配置为 Eclipse IDE 的外部工具。然后我就可以在 IDE 中运行闭包编译器并通过单击缩小我的 Javascript 文件。 有人解决这个问题了吗?

最佳答案

Rock Star Apps 提供了一个鲜为人知的插件来执行此操作。我刚刚写了一篇关于它的博客文章:[已删除,因为不再存在了]。

经过一番谷歌搜索后,我也发现了这个,但尚未测试它:https://github.com/greggian/Eclipse-Closure-Compiler .

更新:Rock Star Apps 网站不再运行。如果我今天尝试这样做,我肯定会下载 closure compiler jar ,编写一个 ant 脚本来运行它(类似于下面的代码),然后为其创建一个项目构建器。

<target name="rebuild">

    <taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask"
            classpath="/opt/closure-compiler/compiler.jar"/>

    <jscomp compilationLevel="simple" warning="quiet" 
        debug="false" output="js/all.closure.js">
        <sources dir="js">
            <file name="script1.js"/>
            <file name="script2.js"/>
            <file name="script3.js"/>
            <file name="script4.js"/>
            <file name="script5.js"/>
            <file name="script6.js"/>
        </sources>
    </jscomp>

</target>

关于eclipse - 将 Google 闭包编译器与 Eclipse IDE 集成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3287771/

相关文章:

java - Android 主/细节流程

java - 是否有一个图像设计社区可以与开发人员合作来创建具有更好、更优美的外观和感觉的应用程序?

iis - 优化网站 - 缩小、 Sprite 等

javascript - 如何将这个区 block 链脚本变成一行?

javascript - Uncaught ReferenceError : showCurrentPage is not defined at HTMLButtonElement. onclick

java - 作为 OSGi 启动插件

java - 是否存在 Eclipse 部署程序集日志?

javascript - 为什么要使用 jquery map ?

javascript - 无法使用点表示法获取值

javascript - 闭包编译器 : could not determine the type of this expression at callback