wildpig 1.1.4 → 1.1.6
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 +1 -1
- package/scripts/WildPig.ts +3 -5
- package/scripts/packageStatic.ts +2 -6
- package/scripts/prepareRoutes.ts +2 -5
- package/public/render.js +0 -27997
- package/public/render.js.gz +0 -0
package/package.json
CHANGED
package/scripts/WildPig.ts
CHANGED
|
@@ -7,8 +7,7 @@ import devIndexHtml from "#/public/devIndex.html"
|
|
|
7
7
|
const env = process.env;
|
|
8
8
|
const isDev = env.NODE_ENV === "development";
|
|
9
9
|
|
|
10
|
-
console.log(metaRoutes);
|
|
11
|
-
|
|
10
|
+
// console.log(metaRoutes);
|
|
12
11
|
|
|
13
12
|
export const startServer = () => {
|
|
14
13
|
Bun.serve({
|
|
@@ -22,9 +21,8 @@ export const startServer = () => {
|
|
|
22
21
|
"content-type": "image/x-icon",
|
|
23
22
|
}
|
|
24
23
|
}),
|
|
25
|
-
"/render.js": () => new Response((readFileSync("./public/render.js
|
|
24
|
+
"/render.js": () => new Response((readFileSync("./public/render.js")), {
|
|
26
25
|
headers: {
|
|
27
|
-
"Content-Encoding": "gzip",
|
|
28
26
|
"Content-Type": "text/javascript; charset=utf-8",
|
|
29
27
|
"Cache-Control": isDev ? "no-cache" : "public, max-age=31536000, immutable"
|
|
30
28
|
}
|
|
@@ -64,7 +62,7 @@ console.log(` __ __ _ _ _ ____ _
|
|
|
64
62
|
\\ V V / | || || (_| | | __/ | || (_| |
|
|
65
63
|
\\_/\\_/ |_||_| \\__,_| |_| |_| \\__, |
|
|
66
64
|
|___/ `)
|
|
67
|
-
console.log(chalk.blue.bgGreen(" 🐗 WildPig version 1.
|
|
65
|
+
console.log(chalk.blue.bgGreen(" 🐗 WildPig version 1.1.6 by eriktse "));
|
|
68
66
|
console.log(chalk.green(" Strong & Fast Fullstack Framework\n"));
|
|
69
67
|
console.log(chalk.green("✨ WildPig is running on port " + env.PORT || 3000));
|
|
70
68
|
if(isDev){
|
package/scripts/packageStatic.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Bun
|
|
2
|
-
import fs
|
|
1
|
+
import Bun from "bun";
|
|
2
|
+
import fs from "node:fs";
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export const packageStatic = async () => {
|
|
@@ -10,10 +10,6 @@ export const packageStatic = async () => {
|
|
|
10
10
|
format: "esm",
|
|
11
11
|
minify: true,
|
|
12
12
|
});
|
|
13
|
-
// 将 ./public/render.js 转为 ./public/render.br
|
|
14
|
-
writeFileSync("./dist/public/render.js.gz", gzipSync(
|
|
15
|
-
Buffer.from(readFileSync("./dist/public/render.js"))
|
|
16
|
-
));
|
|
17
13
|
|
|
18
14
|
/** 打包ico */
|
|
19
15
|
fs.copyFileSync("./public/favicon.ico", "./dist/public/favicon.ico");
|
package/scripts/prepareRoutes.ts
CHANGED
|
@@ -16,12 +16,9 @@ if(isDev){
|
|
|
16
16
|
await Bun.build({
|
|
17
17
|
entrypoints: ["./public/render.tsx"],
|
|
18
18
|
outdir: "./public",
|
|
19
|
-
format: "esm"
|
|
19
|
+
format: "esm",
|
|
20
|
+
minify: true,
|
|
20
21
|
});
|
|
21
|
-
// 将 ./public/render.js 转为 ./public/render.br
|
|
22
|
-
writeFileSync("./public/render.js.gz", gzipSync(
|
|
23
|
-
Buffer.from(readFileSync("./public/render.js"))
|
|
24
|
-
));
|
|
25
22
|
|
|
26
23
|
}else{
|
|
27
24
|
routes = require("#/build/built-routes.ts").default;
|