@react-router/serve 0.0.0-experimental-cb25a21e1 → 0.0.0-experimental-e16afd9b7

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.
Files changed (2) hide show
  1. package/dist/cli.js +8 -8
  2. package/package.json +3 -3
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-cb25a21e1
3
+ * @react-router/serve v0.0.0-experimental-e16afd9b7
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -85,16 +85,16 @@ async function run() {
85
85
  let app = express__default["default"]();
86
86
  app.disable("x-powered-by");
87
87
  app.use(compression__default["default"]());
88
+ app.use(path__default["default"].posix.join(build.publicPath, "assets"), express__default["default"].static(path__default["default"].join(build.assetsBuildDirectory, "assets"), {
89
+ immutable: true,
90
+ maxAge: "1y"
91
+ }));
88
92
  app.use(build.publicPath, express__default["default"].static(build.assetsBuildDirectory, {
89
- setHeaders: function (res, path, stat) {
93
+ // Don't redirect directory index.html request to include a trailing slash
94
+ redirect: false,
95
+ setHeaders: function (res, path) {
90
96
  if (path.endsWith(".data")) {
91
97
  res.set("Content-Type", "text/x-turbo");
92
- } else {
93
- // Cache as an immutable asset for 1 year
94
- // Do this here instead of via the immutable/maxAge headers so we can
95
- // conditionally apply it to assets (which are hashed), and not
96
- // pre-rendered .data files (not hashed)
97
- res.set("Cache-Control", "public, max-age=31536000, immutable");
98
98
  }
99
99
  }
100
100
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/serve",
3
- "version": "0.0.0-experimental-cb25a21e1",
3
+ "version": "0.0.0-experimental-e16afd9b7",
4
4
  "description": "Production application server for React Router",
5
5
  "bugs": {
6
6
  "url": "https://github.com/remix-run/react-router/issues"
@@ -20,8 +20,8 @@
20
20
  "get-port": "5.1.1",
21
21
  "morgan": "^1.10.0",
22
22
  "source-map-support": "^0.5.21",
23
- "@react-router/express": "0.0.0-experimental-cb25a21e1",
24
- "@react-router/node": "0.0.0-experimental-cb25a21e1"
23
+ "@react-router/express": "0.0.0-experimental-e16afd9b7",
24
+ "@react-router/node": "0.0.0-experimental-e16afd9b7"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/compression": "^1.7.0",