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

发布于 2024-11-26 07:55:07 字数 1109 浏览 7 评论 0原文

我按照此处,虽然我用 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]

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. 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]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮生面具三千个 2024-12-03 07:55:07

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

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

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

Add the js assets required by google closure (the ones containing "goog.dom" object) to the wro.xml model. 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). You could also provide a more detailed example with a quickstart project which would help to reproduce the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文