Skip to content

A self-hosted media server and file management system

compress code

aminnausin6ef1b858d32e
diff --git a/app/Http/Resources/CategoryResource.php b/app/Http/Resources/CategoryResource.php
index 7583ae4a..8b7c526f 100755
--- a/app/Http/Resources/CategoryResource.php
+++ b/app/Http/Resources/CategoryResource.php
@@ -13,7 +13,6 @@ class CategoryResource extends JsonResource {
* @return array<string, mixed>
*/
public function toArray(Request $request): array {
-
return [
'id' => (string) $this->id,
'name' => $this->name,
diff --git a/package-lock.json b/package-lock.json
index 5ec1765b..b976edc2 100755
--- a/package-lock.json
+++ b/package-lock.json
@@ -60,6 +60,7 @@
"typescript": "~5.6.3",
"unplugin-icons": "^0.19.0",
"vite": "^5.0.0",
+ "vite-plugin-compression": "^0.5.1",
"vue-tsc": "^2.1.10"
}
},
@@ -3578,6 +3579,21 @@
"url": "https://github.com/sponsors/rawify"
}
},
+ "node_modules/fs-extra": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
+ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -3907,6 +3923,19 @@
"devOptional": true,
"license": "MIT"
},
+ "node_modules/jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
"node_modules/keyv": {
"version": "4.5.4",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
@@ -5477,6 +5506,16 @@
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
"license": "MIT"
},
+ "node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
"node_modules/unplugin": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.16.0.tgz",
@@ -5639,6 +5678,21 @@
}
}
},
+ "node_modules/vite-plugin-compression": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz",
+ "integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^4.1.2",
+ "debug": "^4.3.3",
+ "fs-extra": "^10.0.0"
+ },
+ "peerDependencies": {
+ "vite": ">=2.0.0"
+ }
+ },
"node_modules/vite-plugin-full-reload": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz",
diff --git a/package.json b/package.json
index b08d9ac9..12ff0955 100755
--- a/package.json
+++ b/package.json
@@ -63,6 +63,7 @@
"typescript": "~5.6.3",
"unplugin-icons": "^0.19.0",
"vite": "^5.0.0",
+ "vite-plugin-compression": "^0.5.1",
"vue-tsc": "^2.1.10"
},
"dependencies": {
diff --git a/vite.config.js b/vite.config.js
index 87d279aa..94a960cf 100755
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,12 +1,14 @@
// import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
+import viteCompression from 'vite-plugin-compression';
import laravel from 'laravel-vite-plugin';
import Icons from 'unplugin-icons/vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [
+ viteCompression(),
laravel({
input: ['resources/css/app.css', 'resources/js/app.ts'],
refresh: true,