zoukankan      html  css  js  c++  java
  • maven压缩js css

    maven压缩
    <
    plugin> <!-- YUI Compressor Maven压缩插件 --> <groupId>net.alchim31.maven</groupId> <artifactId>yuicompressor-maven-plugin</artifactId> <version>1.3.0</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>compress</goal> </goals> </execution> </executions> <configuration> <encoding>UTF-8</encoding> <!-- 读取js,css文件采用UTF-8编码 --> <jswarn>false</jswarn> <!-- 不显示js可能的错误 --> <force>false</force> <!-- 若存在已压缩的文件,会先对比源文件是否有改动 有改动便压缩,无改动就不压缩 --> <linebreakpos>-1</linebreakpos> <!-- 在指定的列号后插入新行 --> <preProcessAggregates>true</preProcessAggregates> <!-- 压缩之前先执行聚合文件操作 --> <suffix>.min</suffix> <!-- 压缩后保存文件后缀  <nosuffix>true</nosuffix>   --> <sourceDirectory>${project.basedir}/view</sourceDirectory> <!-- 源目录,即需压缩的根目录 --> <includes> <!-- 压缩js和css文件 --> <include>*.js</include> <include>**/*.css</include> </includes> <excludes> <!-- 以下目录和文件不会被压缩 --> <exclude>**/*.min.js</exclude> <exclude>**/*.min.css</exclude> </excludes> <!-- 压缩后输出文件目录 后面目录安装文件目录生成-->  <outputDirectory>${project.basedir}/view/view_min</outputDirectory> <!-- 聚合文件 --> <aggregations> <aggregation> <insertNewLine>true</insertNewLine> <!-- 合并每一个文件后插入一新行 --> <inputDir>${project.view}/view_min</inputDir> <!-- 需合并文件的根文件夹 --> <output>${project.view}/view_min/all.js</output> <!-- 最终合并的输出文件 --> <includes> <!-- 把以下js文件合并成一个js文件,是按顺序合并的 --> <include>**/*。core.js</include> </includes> </aggregation> </aggregations> </configuration> </plugin>
  • 相关阅读:
    模板---templates
    django框架基础
    文件操作
    C++异常处理基本句法测试
    模板类在包含友元情况下的分离编写
    C++中构造函数作用
    hex文件和bin文件区别
    Keil MDK 和 IAR 两款ARM开发工具区别比较
    ubuntu下安装stm32开发环境
    IAR安装破解教程
  • 原文地址:https://www.cnblogs.com/c-abc/p/8365407.html
Copyright © 2011-2022 走看看