我有一个Maven配置文件,我想要缩小我的所有javascript和css文件。为了开发我有compressed.js
和compressed.css
文件,它们只是注入其他脚本/样式表。我想要的是用实际压缩的文件覆盖那些文件,但只有.js缩小对我有效。
这是我个人资料中的一部分:
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<linebreakpos>999999</linebreakpos>
<jswarn>false</jswarn>
<excludes>
<exclude>**/compressed.js</exclude>
</excludes>
<aggregations>
<aggregation>
<removeIncluded>true</removeIncluded>
<insertNewLine>false</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/js/compressed.js
</output>
<includes>
<include>**/components/sample-min.js</include>
<include>**/components/sample2-min.js</include>
</includes>
<excludes>
<exclude>**/compressed.js</exclude>
</excludes>
</aggregation>
</aggregations>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<excludes>js/**</excludes>
</configuration>
</plugin>
当我修改以下行时,只有当compressed.css
已经存在时,它才会起作用,否则,它会缩小。
添加到yuicompressor-maven-plugin
:
<exclude>**/compressed.css</exclude>
...
<aggregations>
<aggregation>
<removeIncluded>true</removeIncluded>
<insertNewLine>false</insertNewLine>
<output>${project.build.directory}/${project.build.finalName}/css/compressed.css
</output>
<includes>
<include>**/sample-min.css</include>
<include>**/sample2-min.css</include>
</includes>
<excludes>
<exclude>**/compressed.css</exclude>
</excludes>
</aggregation>
maven-war-plugin
改变:
<excludes>
<exclude>js/**</exclude>
<exclude>css/**</exclude>
</excludes>
拜托,我做错了什么?
答案 0 :(得分:0)
Yui压缩程序非常老,无法压缩.js文件。我将yui压缩器用于.css,并将谷歌关闭编译器用于.js文件。代码如下所示。它们会缩小您的所有.css和.js文件,并在项目的构建阶段覆盖它们。
df = pd.read_excel("file.xlsx")
print (df)
Users: Locked:
user1 NaN
user2 NaN