wildpig 1.1.3 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildpig",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "author": "eriktse",
5
5
  "main": "index.ts",
6
6
  "dependencies": {
package/public/render.js CHANGED
@@ -22344,6 +22344,7 @@ function useViewTransitionState(to, { relative } = {}) {
22344
22344
 
22345
22345
  // node_modules/react-router/dist/development/index.mjs
22346
22346
  "use client";
22347
+
22347
22348
  // src/page/layout.tsx
22348
22349
  var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
22349
22350
  var MainLayout = () => {
Binary file
@@ -22,9 +22,9 @@ export const startServer = () => {
22
22
  "content-type": "image/x-icon",
23
23
  }
24
24
  }),
25
- "/render.js": () => new Response((readFileSync("./public/render.js.br")), {
25
+ "/render.js": () => new Response((readFileSync("./public/render.js.gz")), {
26
26
  headers: {
27
- "Content-Encoding": "br",
27
+ "Content-Encoding": "gzip",
28
28
  "Content-Type": "text/javascript; charset=utf-8",
29
29
  "Cache-Control": isDev ? "no-cache" : "public, max-age=31536000, immutable"
30
30
  }
@@ -1,6 +1,5 @@
1
- import Bun from "bun";
1
+ import Bun, { gzipSync } from "bun";
2
2
  import fs, { readFileSync, writeFileSync } from "node:fs";
3
- import { brotliCompressSync, constants } from "node:zlib";
4
3
 
5
4
 
6
5
  export const packageStatic = async () => {
@@ -12,15 +11,8 @@ export const packageStatic = async () => {
12
11
  minify: true,
13
12
  });
14
13
  // 将 ./public/render.js 转为 ./public/render.br
15
- writeFileSync("./dist/public/render.js.br", brotliCompressSync(
16
- Buffer.from(readFileSync("./dist/public/render.js")),
17
- {
18
- params: {
19
- [constants.BROTLI_PARAM_QUALITY]: 11, // 最高质量
20
- [constants.BROTLI_PARAM_LGWIN]: 16, // 最大窗口 16 MB
21
- [constants.BROTLI_PARAM_MODE]: constants.BROTLI_MODE_TEXT, // 针对文本优化
22
- }
23
- }
14
+ writeFileSync("./dist/public/render.js.gz", gzipSync(
15
+ Buffer.from(readFileSync("./dist/public/render.js"))
24
16
  ));
25
17
 
26
18
  /** 打包ico */
@@ -1,6 +1,6 @@
1
1
  import { readFileSync, writeFileSync } from "node:fs";
2
2
  import { scanMetaRoutes, scanRoutes } from "./genRoutes";
3
- import { brotliCompressSync } from "node:zlib";
3
+ import { gzipSync } from "bun";
4
4
 
5
5
  const isDev = process.env.NODE_ENV === "development";
6
6
 
@@ -19,7 +19,9 @@ if(isDev){
19
19
  format: "esm"
20
20
  });
21
21
  // 将 ./public/render.js 转为 ./public/render.br
22
- writeFileSync("./public/render.js.br", brotliCompressSync(Buffer.from(readFileSync("./public/render.js"))));
22
+ writeFileSync("./public/render.js.gz", gzipSync(
23
+ Buffer.from(readFileSync("./public/render.js"))
24
+ ));
23
25
 
24
26
  }else{
25
27
  routes = require("#/build/built-routes.ts").default;
Binary file