@react-router/serve 0.0.0-experimental-19ee411dc → 0.0.0-experimental-667adc806
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/dist/cli.js +9 -4
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/serve v0.0.0-experimental-
|
|
3
|
+
* @react-router/serve v0.0.0-experimental-667adc806
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -112,22 +112,27 @@ async function run() {
|
|
|
112
112
|
};
|
|
113
113
|
let app = (0, import_express2.default)();
|
|
114
114
|
app.disable("x-powered-by");
|
|
115
|
-
app.use((0, import_compression.default)());
|
|
116
115
|
app.use(
|
|
117
116
|
import_node_path.default.posix.join(build.publicPath, "assets"),
|
|
117
|
+
(0, import_compression.default)(),
|
|
118
118
|
import_express2.default.static(import_node_path.default.join(build.assetsBuildDirectory, "assets"), {
|
|
119
119
|
immutable: true,
|
|
120
120
|
maxAge: "1y"
|
|
121
121
|
})
|
|
122
122
|
);
|
|
123
|
-
app.use(
|
|
124
|
-
|
|
123
|
+
app.use(
|
|
124
|
+
build.publicPath,
|
|
125
|
+
(0, import_compression.default)(),
|
|
126
|
+
import_express2.default.static(build.assetsBuildDirectory)
|
|
127
|
+
);
|
|
128
|
+
app.use((0, import_compression.default)(), import_express2.default.static("public", { maxAge: "1h" }));
|
|
125
129
|
app.use((0, import_morgan.default)("tiny"));
|
|
126
130
|
if (isRSCServerBuild(build)) {
|
|
127
131
|
app.all("*", (0, import_node_fetch_server.createRequestListener)(build.fetch));
|
|
128
132
|
} else {
|
|
129
133
|
app.all(
|
|
130
134
|
"*",
|
|
135
|
+
(0, import_compression.default)(),
|
|
131
136
|
(0, import_express.createRequestHandler)({
|
|
132
137
|
build,
|
|
133
138
|
mode: process.env.NODE_ENV
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/serve",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-667adc806",
|
|
4
4
|
"description": "Production application server for React Router",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/remix-run/react-router/issues"
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"get-port": "5.1.1",
|
|
39
39
|
"morgan": "^1.10.0",
|
|
40
40
|
"source-map-support": "^0.5.21",
|
|
41
|
-
"@react-router/
|
|
42
|
-
"@react-router/
|
|
41
|
+
"@react-router/express": "0.0.0-experimental-667adc806",
|
|
42
|
+
"@react-router/node": "0.0.0-experimental-667adc806"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"react-router": "0.0.0-experimental-
|
|
45
|
+
"react-router": "0.0.0-experimental-667adc806"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/compression": "^1.7.0",
|