交响乐 2 + Assetic 运行时 Java 错误

发布于 2024-11-26 15:31:29 字数 808 浏览 0 评论 0原文

我正在尝试设置我的 Symfony 2 项目来组合和压缩许多 javascript 文件。下面是我用来完成此操作的标签示例:

{% javascripts 'bundles/acmedemo/js/*' output='js/plugins.js' filter='closure' %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

我已配置映射到 yui 压缩器 jar。

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        closure:
            jar: %kernel.root_dir%/java/yuicompressor-2.4.6.jar
        yui_css:
            jar: %kernel.root_dir%/java/yuicompressor-2.4.6.jar

当我尝试在浏览器中打开页面时,需要一段时间才能加载,并且不包含输出文件。我尝试运行 app/console assetic:dump 命令并收到此错误:

[RuntimeException] 如果未指定输入文件,则默认为 stdin。在这种情况下,需要“类型”选项。否则,仅当输入时才需要“类型”选项。 Windows 提示符将其切断。

还有其他人遇到过这个问题吗?

I'm trying to set my Symfony 2 project to combine and compress a number of javascript files. Below is an example of the tag I'm using to accomplish this:

{% javascripts 'bundles/acmedemo/js/*' output='js/plugins.js' filter='closure' %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

I've config to map to the yui compressor jar.

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        closure:
            jar: %kernel.root_dir%/java/yuicompressor-2.4.6.jar
        yui_css:
            jar: %kernel.root_dir%/java/yuicompressor-2.4.6.jar

When I try to bring up the page in the browser it takes a while to load and doesn't include the output file. I tried to run the app/console assetic:dump command and got this error:

[RuntimeException]
If no input file is specified, it defaults to stdin. In this case, the 'type' option is required. Otherwise, the 'type' option is required only if the input. And the windows prompt cuts it off.

Has anyone else encountered this issue?

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

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

发布评论

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

评论(3

半枫 2024-12-03 15:31:29

您的 yuicompressor 文件实际上位于 %kernel.root_dir%/java/yuicompressor-2.4.6.jar 中吗?不是 %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar

检查此链接,也许会有帮助 http://groups.google.com/group/symfony2/browse_thread/thread/dde8b418813bab37/1d4e42a7396f2e0f?lnk=gst&q=yui

Is you yuicompressor file actually located in %kernel.root_dir%/java/yuicompressor-2.4.6.jar ? not %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar ?

Check this link, maybe something will help http://groups.google.com/group/symfony2/browse_thread/thread/dde8b418813bab37/1d4e42a7396f2e0f?lnk=gst&q=yui

£烟消云散 2024-12-03 15:31:29

另外:路径必须放入:“”
配置将如下所示:

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        closure:
            jar: "%kernel.root_dir%/java/yuicompressor-2.4.6.jar"
        yui_css:
            jar: "%kernel.root_dir%/java/yuicompressor-2.4.6.jar"

Additionaly: the path has to be put in: ""
The config will look like this:

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        closure:
            jar: "%kernel.root_dir%/java/yuicompressor-2.4.6.jar"
        yui_css:
            jar: "%kernel.root_dir%/java/yuicompressor-2.4.6.jar"
桃扇骨 2024-12-03 15:31:29

以下并不是错误,但您似乎将 Yahoo 的 YUI 压缩器配置为“关闭”。 Google Closure 是一个不同的 JS 压缩工具。

The following isn't an error as such but you seem to be configuring the YUI compressor from Yahoo as 'closure'. Google Closure is a different JS compression tool.

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