From bcaa327494900550743c1d8006b4ab9c227b43c6 Mon Sep 17 00:00:00 2001 From: wherewhere Date: Tue, 3 Dec 2024 16:41:52 +0800 Subject: [PATCH] feat: add .webmanifest as json, add .map and .wasm to compressing --- README.md | 11 +++++++++++ index.js | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 39efae3..9343c10 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,9 @@ minify: enable: false include: - "*.json" + - "*.webmanifest" - "!*.min.json" + - "!*.min.webmanifest" ``` - **enable** - Enable the plugin. Defaults to `false`. @@ -197,6 +199,8 @@ minify: - "*.html" - "*.css" - "*.js" + - "*.map" + - "*.wasm" - "*.txt" - "*.ttf" - "*.atom" @@ -205,6 +209,7 @@ minify: - "*.svg" - "*.eot" - "*.json" + - "*.webmanifest" ``` - **enable** - Enable the plugin. Defaults to `true`. @@ -226,6 +231,8 @@ minify: - "*.html" - "*.css" - "*.js" + - "*.map" + - "*.wasm" - "*.txt" - "*.ttf" - "*.atom" @@ -234,6 +241,7 @@ minify: - "*.svg" - "*.eot" - "*.json" + - "*.webmanifest" ``` - **enable** - Enable the plugin. Defaults to `true`. @@ -253,6 +261,8 @@ minify: - "*.html" - "*.css" - "*.js" + - "*.map" + - "*.wasm" - "*.txt" - "*.ttf" - "*.atom" @@ -261,6 +271,7 @@ minify: - "*.svg" - "*.eot" - "*.json" + - "*.webmanifest" ``` - **enable** - Enable the plugin. Defaults to `false`. diff --git a/index.js b/index.js index 2b64661..c9235be 100644 --- a/index.js +++ b/index.js @@ -81,7 +81,7 @@ hexo.config.minify.gzip = { enable: true, priority: 10, verbose: false, - include: ['*.html', '*.css', '*.js', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json', '*.webmanifest'], + include: ['*.html', '*.css', '*.js', '*.map', '*.wasm', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json', '*.webmanifest'], globOptions: { basename: true }, ...hexo.config.minify.gzip } @@ -90,7 +90,7 @@ hexo.config.minify.brotli = { enable: true, priority: 10, verbose: false, - include: ['*.html', '*.css', '*.js', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json', '*.webmanifest'], + include: ['*.html', '*.css', '*.js', '*.map', '*.wasm', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json', '*.webmanifest'], globOptions: { basename: true }, ...hexo.config.minify.brotli } @@ -99,7 +99,7 @@ hexo.config.minify.zstd = { enable: false, priority: 10, verbose: false, - include: ['*.html', '*.css', '*.js', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json', '*.webmanifest'], + include: ['*.html', '*.css', '*.js', '*.map', '*.wasm', '*.txt', '*.ttf', '*.atom', '*.stl', '*.xml', '*.svg', '*.eot', '*.json', '*.webmanifest'], globOptions: { basename: true }, ...hexo.config.minify.zstd }