{"id":25884869,"url":"https://github.com/joylau/joylau-compressor-plugins","last_synced_at":"2026-03-17T01:47:27.215Z","repository":{"id":57715976,"uuid":"106802038","full_name":"JoyLau/joylau-compressor-plugins","owner":"JoyLau","description":"一款基于YUI Compressor 打包压缩 js css html 的Maven插件","archived":false,"fork":false,"pushed_at":"2017-10-19T02:10:04.000Z","size":40,"stargazers_count":6,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T18:54:14.490Z","etag":null,"topics":["compressor","csscompressor","htmlcompressor","jscompressor","mavenplugin","plugin"],"latest_commit_sha":null,"homepage":"https://github.com/JoyLau/joylau-compressor-plugins","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoyLau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-13T09:02:53.000Z","updated_at":"2024-07-10T09:46:03.000Z","dependencies_parsed_at":"2022-09-12T10:41:47.906Z","dependency_job_id":null,"html_url":"https://github.com/JoyLau/joylau-compressor-plugins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoyLau%2Fjoylau-compressor-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoyLau%2Fjoylau-compressor-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoyLau%2Fjoylau-compressor-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoyLau%2Fjoylau-compressor-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoyLau","download_url":"https://codeload.github.com/JoyLau/joylau-compressor-plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241541557,"owners_count":19979140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compressor","csscompressor","htmlcompressor","jscompressor","mavenplugin","plugin"],"created_at":"2025-03-02T17:19:08.057Z","updated_at":"2026-03-17T01:47:27.124Z","avatar_url":"https://github.com/JoyLau.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 一款打包压缩 js css html 的Maven插件\n\n\n## 怎么使用？\npom 中引入插件：\n``` xml\n    \u003cplugin\u003e\n        \u003cgroupId\u003ecn.joylau.code\u003c/groupId\u003e\n        \u003cartifactId\u003ejoylau-compressor-plugins\u003c/artifactId\u003e\n        \u003cversion\u003e1.2.RELEASE\u003c/version\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cid\u003eresource-compressor\u003c/id\u003e\n                \u003cphase\u003ecompile\u003c/phase\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eresource-compressor\u003c/goal\u003e\n                \u003c/goals\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n        \u003cconfiguration\u003e\n            \u003ccssConfigs\u003e\n                \u003ccssConfig\u003e\n                    \u003cdir\u003e/static/css\u003c/dir\u003e\n                    \u003cinclude\u003e*.css\u003c/include\u003e\n                    \u003cexclude\u003e*.min.css\u003c/exclude\u003e\n                \u003c/cssConfig\u003e\n            \u003c/cssConfigs\u003e\n            \u003cjsConfigs\u003e\n                \u003cjsConfig\u003e\n                    \u003cdir\u003e/static/js\u003c/dir\u003e\n                    \u003cinclude\u003e*.js\u003c/include\u003e\n                    \u003cexclude\u003e*.min.js\u003c/exclude\u003e\n                    \u003cmunge\u003etrue\u003c/munge\u003e\n                \u003c/jsConfig\u003e\n            \u003c/jsConfigs\u003e\n            \u003chtmlConfigs\u003e\n                \u003chtmlConfig\u003e\n                    \u003cdir\u003e/templates\u003c/dir\u003e\n                    \u003cinclude\u003e*.html\u003c/include\u003e\n                    \u003cremoveIntertagSpaces\u003etrue\u003c/removeIntertagSpaces\u003e\n                    \u003ccompressJavaScript\u003efalse\u003c/compressJavaScript\u003e\n                    \u003ccompressCss\u003etrue\u003c/compressCss\u003e\n                \u003c/htmlConfig\u003e\n            \u003c/htmlConfigs\u003e\n        \u003c/configuration\u003e\n    \u003c/plugin\u003e\n```\n\n## 配置解释\n- `phase` : compile 表明该插件在 compile 时调用\n- `goal` ： 固定为 resource-compressor 不需要改变\n- `cssConfigs` , 可配置多个 cssConfig\n    - cssConfig \n        - dir： css文件目录\n        - include：包含的css文件，支持通配符\n        - exclude：排除的css文件，支持通配符\n\n\n- `jsConfigs` , 可配置多个 jsConfig\n    - jsConfig \n        - dir： js文件目录\n        - include：包含的js文件，支持通配符\n        - exclude：排除的js文件，支持通配符\n        - munge: 是否进行代码混淆，缺省值为 false\n        - preserveAllSemiColons : 保留所有的分号，缺省值为 false\n        - disableOptimizations : 禁用自带的所有优化措施，缺省值为 false\n\n\n- `htmlConfigs` , 可配置多个 htmlConfig\n    - htmlConfig \n        - dir： js文件目录\n        - include：包含的js文件，支持通配符\n        - exclude：排除的js文件，支持通配符\n        - removeComments: 是否移除注释，缺省值为 true\n        - removeIntertagSpaces : 是否移除标签之间的空格，缺省值为 false\n        - compressJavaScript : 是否对html里的js代码进行压缩，缺省值为 false\n        - compressCss : 是否对html里的css代码进行压缩，缺省值为 false\n        \n## 压缩信息\n当看到以下图片所示的信息后，则压缩成功\n\n![joylau-compressor-plugins](http://image.joylau.cn/blog/resource-compressor.png)\n\n例如 ：[INFO] common.js(8.71KB==\u003e4.58KB,47.39%)\n\n表示 ：common.js 源文件大小8.71KB，压缩后大小 4.58KB，压缩率47.39%\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoylau%2Fjoylau-compressor-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoylau%2Fjoylau-compressor-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoylau%2Fjoylau-compressor-plugins/lists"}