简体   繁体   English

如何将wro4j与Closure库和编译器一起使用?

[英]How do you use wro4j together with the Closure library and compiler?

I followed the instructions at here , though I substituted 1.3.8 for the version, and I'm able to compile my JS in a wildcard folder as I wanted, however, I'm not quite sure where to place the closure library files so the compiler will pick them up. 我按照此处的说明进行操作,尽管我用1.3.8代替了该版本,并且可以根据需要在通配符文件夹中编译JS,但是,我不确定在何处放置闭包库文件,因此编译器会选择它们。 Where is this configured? 在哪里配置?

[INFO] Wro4j Model path: .\src\main\webapp\WEB-INF\wro.xml
[INFO] targetGroups: closure
[INFO] minimize: true
[INFO] ignoreMissingResources: false
[INFO] destinationFolder: .\src\main\webapp\wro
[INFO] jsDestinationFolder: d:\static\compiled\js
[INFO] cssDestinationFolder: d:\static\compiled\css
[INFO] folder: d:\static\compiled\css
[INFO] processing group: closure.css
[INFO] file size: closure.css -> 0 bytes
[INFO] No content found for group: closure.css
[INFO] folder: d:\static\compiled\js
[INFO] processing group: closure.js
Jul 24, 2011 10:55:59 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /static/compiled/js/**:1: ERROR - required "goog.dom" namespace never provided
goog.require('goog.dom');
            ^

[INFO] file size: closure.js -> 204 bytes
[INFO] d:\static\compiled\js\closure.js (204bytes) has been created!
[INFO]

Add the js assets required by google closure (the ones containing "goog.dom" object) to the wro.xml model. 将Google闭包所需的js资产(包含“ goog.dom”对象的js资产)添加到wro.xml模型中。 Example: 例:

    <groups>
      <group name="closure">
        <js>/path/to/goog-dom.js</js>
        <js>/files/*.js</js>
      </group>
    </groups>

If this doesn't help, post the same question on google closure & wro4j mailing list (to target the right audience). 如果这样做无济于事,请在Google关闭和wro4j邮件列表中发布相同的问题(以定位合适的受众群体)。 You could also provide a more detailed example with a quickstart project which would help to reproduce the problem. 您还可以通过快速入门项目提供更详细的示例,这将有助于重现该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM