我刚刚从https://github.com/yui/yuicompressor下载了yuicompressor-master,并计划在我的symfony2应用程序中使用它。问题是没有yuicompressor.jar文件。
我猜想我需要从yuicompressor-master文件夹中的文件构建.jar文件,但是过了一段时间(我尝试避免使用google),duckduckgo'in找不到关于我应该如何构建的说明。罐子,如果那是需要做的。
我在命令行上很舒服,也不介意阅读一些帮助文档以弄清楚这一点。谁能指出我正确的方向?如果这是一个愚蠢的问题,我深表歉意,我显然没有使用Java的经验。谢谢!
我正在尝试使用该debugger;语句在Firefox中调试JS,但YUI Compressor正在干扰.
在未压缩的文件中,但在压缩文件中不会发生Firefox的完全暂停.对于调试,我想使用该debugger;语句,因为当YUI将所有内容整齐地放入一行时,手动设置断点是不可能的.
现在,YUI debugger;从源代码中删除了该语句.
有没有办法保留debugger;声明?
我正在寻找Maven配置来最小化Spring Boot应用程序的js / css文件。对于普通的Java Web应用程序,以下配置有效
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
<webappDirectory>${project.build.directory}/min</webappDirectory>
<excludes>
<exclude>**/*-min.js</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}/min</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
但是当我用弹簧靴尝试这个
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
<webappDirectory>${project.build.directory}</webappDirectory>
<excludes>
<exclude>**/*-min.js</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*-min.css</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<excludes>
<exclude>**/*.js</exclude>
</excludes>
</configuration>
<goals>
<goal>repackage</goal>
</goals>
</execution> …Run Code Online (Sandbox Code Playgroud) 你能从Java应用程序中运行YUICompressor吗?
我是Java编程的新手,所以答案可能很明显,但它已经提到了我.
我使用本指南将yui_compressor添加到我的symfony项目中.但它没有创建缩小的文件.以下是我应用的设置,请看一看并告诉我可能出现的问题.配置文件
// Added this to the config.yml file in app/config (and yes, I'm on a mac)
yui_css:
jar: "%kernel.root_dir%/Resources/filter/java/yuicompressor-2.4.7.jar"
java: /usr/bin/java
Run Code Online (Sandbox Code Playgroud)
基础树枝
// Added this to the :base.html.twig in app/Resources/views
{% stylesheets filter='yui_css' output='public/css/compiled-main.css'
'public/css/main.css'
%}
Run Code Online (Sandbox Code Playgroud)
将构建中的yui_compressor zip文件中的文件添加到symfony项目中的app/Resources/filter/java文件夹中
我尝试在PhpStorm中设置YUI Compressor。我已经安装了Node.js并在PhpStorm中对其进行了配置,如下图所示。但是在运行时会显示“未处理的'错误'事件”,请参见其他屏幕截图。
java ×2
javascript ×2
assetic ×1
debugging ×1
installation ×1
jar ×1
minify ×1
node.js ×1
pagespeed ×1
phpstorm ×1
spring-boot ×1
symfony ×1
yui ×1