Integrate Google closure compiler with Eclipse IDE

2019-03-09 07:56发布

Does anybody know how to integrate Google closure compiler with Eclipse IDE? The thing I was trying to do is to configure Google closure compiler as a external tool for Eclipse IDE. Then I would be able to run closure compiler within IDE and minify my Javascript files with single click. Have anybody solved this problem yet?

5条回答
\"骚年 ilove
2楼-- · 2019-03-09 08:20

try these eclipse plugins:

Eclipse Plugin for Closure Templates

Eclipse Plugin for JavaScript with Closure Compiler and Closure Library

http://www.normalesup.org/~simonet/soft/index.en.html

everything works!

查看更多
倾城 Initia
3楼-- · 2019-03-09 08:21

This podcast has some info on how the closure compiler might fit into the IDE. But it was published before closure was released.

查看更多
Deceive 欺骗
4楼-- · 2019-03-09 08:22
Anthone
5楼-- · 2019-03-09 08:26

Rock Star Apps provide a little-known plugin which does this. I just wrote a blog article on it: [removed as doesn't exist anymore].

After some googling, I also found this, but haven't tested it: https://github.com/greggian/Eclipse-Closure-Compiler.

Update: the Rock Star Apps site no longer works. Were I to try to do this today, I would definitely just download the closure compiler jar, write an ant script to run it (something like the code below), and then create a project builder for it.

<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>
查看更多
淡お忘
6楼-- · 2019-03-09 08:43

You might be interested in http://plovr.com/, a Closure build tool. It dynamically recompiles JavaScript and Closure Template code.

查看更多
登录 后发表回答