浏览代码

集成yuicompressor实现(CSS/JS压缩)

RuoYi 3 年之前
父节点
当前提交
2abe93d45b

+ 33 - 1
ruoyi-admin/pom.xml

@@ -106,7 +106,39 @@
                     <failOnMissingWebXml>false</failOnMissingWebXml>
                     <warName>${project.artifactId}</warName>
                 </configuration>   
-           </plugin>   
+            </plugin>   
+            <!-- YUI Compressor (CSS/JS压缩) 
+            <plugin>
+                <groupId>net.alchim31.maven</groupId>
+                <artifactId>yuicompressor-maven-plugin</artifactId>
+                <version>1.5.1</version>
+                <executions>
+                    <execution>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>compress</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <encoding>UTF-8</encoding>
+                    <jswarn>false</jswarn>
+                    <nosuffix>true</nosuffix>
+                    <linebreakpos>50000</linebreakpos>
+                    <sourceDirectory>src/main/resources/static</sourceDirectory>
+                    <force>true</force>
+                    <includes>
+                        <include>**/*.js</include>
+                        <include>**/*.css</include>
+                    </includes>
+                    <excludes>
+                        <exclude>**/*.min.js</exclude>
+                        <exclude>**/*.min.css</exclude>
+                        <exclude>**/fileinput.js</exclude>
+                        <exclude>**/bootstrap-treetable.js</exclude>
+                    </excludes>
+                </configuration>
+            </plugin> -->
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>

+ 0 - 0
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder.js → ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder.min.js


文件差异内容过多而无法显示
+ 4 - 0
ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-treetable/bootstrap-treetable.min.js


+ 0 - 0
ruoyi-admin/src/main/resources/static/ajax/libs/report/echarts/echarts-all.js → ruoyi-admin/src/main/resources/static/ajax/libs/report/echarts/echarts-all.min.js


+ 3 - 3
ruoyi-admin/src/main/resources/templates/include.html

@@ -31,7 +31,7 @@
 	<script th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
 	<script th:src="@{/ajax/libs/validate/jquery.validate.extend.js}"></script>
 	<!-- jquery-validate 表单树插件 -->
-	<script th:src="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.js}"></script>
+	<script th:src="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.min.js?v=20210526}"></script>
 	<!-- 遮罩层 -->
 	<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
     <script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
@@ -157,7 +157,7 @@
 
 <!-- ECharts百度统计图表插件 -->
 <div th:fragment="echarts-js">
-    <script th:src="@{/ajax/libs/report/echarts/echarts-all.js}"></script>
+    <script th:src="@{/ajax/libs/report/echarts/echarts-all.min.js}"></script>
 </div>
 
 <!-- peity图表组合插件 -->
@@ -172,7 +172,7 @@
 
 <!-- 表格行拖拽插件 -->
 <div th:fragment="bootstrap-table-reorder-js">
-	<script th:src="@{/ajax/libs/bootstrap-table/extensions/reorder/bootstrap-table-reorder.js}"></script>
+	<script th:src="@{/ajax/libs/bootstrap-table/extensions/reorder/bootstrap-table-reorder.min.js}"></script>
 	<script th:src="@{/ajax/libs/bootstrap-table/extensions/reorder/jquery.tablednd.js}"></script>
 </div>
 

部分文件因为文件数量过多而无法显示