@kenjura/ursa 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/meta/menu.js +44 -13
- package/package.json +2 -1
- package/src/helper/automenu.js +23 -12
- package/src/helper/build/autoIndex.js +197 -0
- package/src/helper/build/batch.js +19 -0
- package/src/helper/build/cacheBust.js +62 -0
- package/src/helper/build/excludeFilter.js +67 -0
- package/src/helper/build/footer.js +113 -0
- package/src/helper/build/index.js +13 -0
- package/src/helper/build/menu.js +19 -0
- package/src/helper/build/metadata.js +30 -0
- package/src/helper/build/pathUtils.js +13 -0
- package/src/helper/build/progress.js +35 -0
- package/src/helper/build/templates.js +30 -0
- package/src/helper/build/titleCase.js +7 -0
- package/src/helper/build/watchCache.js +26 -0
- package/src/jobs/generate.js +82 -573
- package/src/serve.js +10 -0
package/src/serve.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import express from "express";
|
|
2
|
+
import compression from "compression";
|
|
2
3
|
import watch from "node-watch";
|
|
3
4
|
import { generate, regenerateSingleFile, clearWatchCache } from "./jobs/generate.js";
|
|
4
5
|
import { join, resolve, dirname } from "path";
|
|
@@ -252,6 +253,15 @@ export async function serve({
|
|
|
252
253
|
function serveFiles(outputDir, port = 8080) {
|
|
253
254
|
const app = express();
|
|
254
255
|
|
|
256
|
+
// Enable gzip compression for all responses
|
|
257
|
+
// This significantly reduces transfer size for JSON and HTML files
|
|
258
|
+
app.use(compression({
|
|
259
|
+
// Compress everything over 1KB
|
|
260
|
+
threshold: 1024,
|
|
261
|
+
// Use default compression level (good balance of speed vs size)
|
|
262
|
+
level: 6
|
|
263
|
+
}));
|
|
264
|
+
|
|
255
265
|
app.use(
|
|
256
266
|
express.static(outputDir, { extensions: ["html"], index: "index.html" })
|
|
257
267
|
);
|