wildpig 1.5.5 → 1.5.7
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/build.ts +1 -1
- package/scripts/prodServer.ts +3 -1
package/package.json
CHANGED
package/scripts/build.ts
CHANGED
|
@@ -14,7 +14,6 @@ const prebuild = async () => {
|
|
|
14
14
|
// 编译服务端入口文件
|
|
15
15
|
promises.push(viteBuild({
|
|
16
16
|
configFile: path.resolve(__dirname, "../../../vite.config.ts"),
|
|
17
|
-
|
|
18
17
|
build: {
|
|
19
18
|
rollupOptions:{
|
|
20
19
|
input: path.resolve(__dirname, "../entry/server.tsx"),
|
|
@@ -36,6 +35,7 @@ export const build = async () => {
|
|
|
36
35
|
entrypoints: [path.resolve(__dirname, "./prodServer.ts")],
|
|
37
36
|
compile: true,
|
|
38
37
|
outdir: "./dist",
|
|
38
|
+
external: ["*.css"],
|
|
39
39
|
define: {
|
|
40
40
|
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
41
41
|
},
|
package/scripts/prodServer.ts
CHANGED
|
@@ -54,7 +54,9 @@ export const startServer = async () => {
|
|
|
54
54
|
return new Response(Bun.file(filepath));
|
|
55
55
|
}
|
|
56
56
|
// 文件不存在
|
|
57
|
-
return new Response("Not Found", {status: 404
|
|
57
|
+
return new Response("Not Found", {status: 404, headers: {
|
|
58
|
+
"Cache-Control": "public, max-age=864000" // 10 天缓存
|
|
59
|
+
}});
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
// 请求服务端数据
|