@remix-run/serve 0.0.0-experimental-ae984c8e → 0.0.0-experimental-37286ee6
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/cli.js +1 -1
- package/env.js +1 -1
- package/index.js +16 -2
- package/package.json +9 -6
package/cli.js
CHANGED
package/env.js
CHANGED
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @remix-run/serve v0.0.0-experimental-
|
|
2
|
+
* @remix-run/serve v0.0.0-experimental-37286ee6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -26,7 +26,21 @@ var morgan__default = /*#__PURE__*/_interopDefaultLegacy(morgan);
|
|
|
26
26
|
function createApp(buildPath, mode = "production") {
|
|
27
27
|
let app = express__default["default"]();
|
|
28
28
|
app.disable("x-powered-by");
|
|
29
|
-
app.use(compression__default["default"](
|
|
29
|
+
app.use(compression__default["default"]({
|
|
30
|
+
filter(req) {
|
|
31
|
+
// No compression for html document requests to allow for streaming
|
|
32
|
+
if (req.headers["accept"] && req.headers["accept"].indexOf("text/html") !== -1) {
|
|
33
|
+
return false;
|
|
34
|
+
} // No compression for _data requests to allow for streaming
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
// TODO: Detect data requests, otherwise compress
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}));
|
|
30
44
|
app.use("/build", express__default["default"].static("public/build", {
|
|
31
45
|
immutable: true,
|
|
32
46
|
maxAge: "1y"
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remix-run/serve",
|
|
3
|
+
"version": "0.0.0-experimental-37286ee6",
|
|
3
4
|
"description": "Production application server for Remix",
|
|
4
|
-
"
|
|
5
|
-
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/remix-run/remix/issues"
|
|
7
|
+
},
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
10
|
"url": "https://github.com/remix-run/remix",
|
|
9
11
|
"directory": "packages/remix-serve"
|
|
10
12
|
},
|
|
11
|
-
"
|
|
12
|
-
"url": "https://github.com/remix-run/remix/issues"
|
|
13
|
-
},
|
|
13
|
+
"license": "MIT",
|
|
14
14
|
"bin": {
|
|
15
15
|
"remix-serve": "cli.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@remix-run/express": "0.0.0-experimental-
|
|
18
|
+
"@remix-run/express": "0.0.0-experimental-37286ee6",
|
|
19
19
|
"compression": "^1.7.4",
|
|
20
20
|
"express": "^4.17.1",
|
|
21
21
|
"morgan": "^1.10.0"
|
|
@@ -24,5 +24,8 @@
|
|
|
24
24
|
"@types/compression": "^1.7.0",
|
|
25
25
|
"@types/express": "^4.17.9",
|
|
26
26
|
"@types/morgan": "^1.9.2"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=14"
|
|
27
30
|
}
|
|
28
31
|
}
|