2

我按照此处的说明进行操作,尽管我用 1.3.8 代替了版本,并且可以根据需要在通配符文件夹中编译我的 JS,但是,我不太确定在哪里放置闭包库文件所以编译器会选择它们。这是在哪里配置的?

[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]
4

1 回答 1

1

将 google 闭包所需的 js 资产(包含“goog.dom”对象的那些)添加到 wro.xml 模型中。例子:

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

如果这没有帮助,请在 google 关闭和 wro4j 邮件列表上发布相同的问题(以针对正确的受众)。您还可以通过快速入门项目提供更详细的示例,这将有助于重现问题。

于 2011-07-24T22:02:39.627 回答