交响乐 2 + Assetic 运行时 Java 错误
我正在尝试设置我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的 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
另外:路径必须放入:“”
配置将如下所示:
Additionaly: the path has to be put in: ""
The config will look like this:
以下并不是错误,但您似乎将 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.