@netlify/vite-plugin-react-router 2.1.1 → 2.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.2](https://github.com/netlify/remix-compute/compare/vite-plugin-react-router-v2.1.1...vite-plugin-react-router-v2.1.2) (2025-11-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **vite-plugin-react-router:** fix custom `build.assetsDir` edge case ([#578](https://github.com/netlify/remix-compute/issues/578)) ([7316d95](https://github.com/netlify/remix-compute/commit/7316d95ea087e19dffe9414749c891642096c4cd))
9
+
3
10
  ## [2.1.1](https://github.com/netlify/remix-compute/compare/vite-plugin-react-router-v2.1.0...vite-plugin-react-router-v2.1.1) (2025-11-06)
4
11
 
5
12
 
package/dist/index.js CHANGED
@@ -109,10 +109,11 @@ function createRequestHandler({
109
109
  var import_promises = require("fs/promises");
110
110
  var import_node_path = require("path");
111
111
  var import_posix = require("path/posix");
112
+ var import_tinyglobby = require("tinyglobby");
112
113
 
113
114
  // package.json
114
115
  var name = "@netlify/vite-plugin-react-router";
115
- var version = "2.1.1";
116
+ var version = "2.1.2";
116
117
 
117
118
  // src/plugin.ts
118
119
  var NETLIFY_FUNCTIONS_DIR = ".netlify/v1/functions";
@@ -245,12 +246,14 @@ function netlifyPlugin(options = {}) {
245
246
  const handlerPath = (0, import_node_path.join)(resolvedConfig.build.outDir, `${FUNCTION_HANDLER_CHUNK}.js`);
246
247
  if (edge) {
247
248
  const clientDir = (0, import_node_path.join)(resolvedConfig.build.outDir, "..", "client");
248
- const entries = await (0, import_promises.readdir)(clientDir, { withFileTypes: true });
249
- const excludedPath = [
250
- "/.netlify/*",
251
- ...entries.map((entry) => entry.isDirectory() ? `/${entry.name}/*` : `/${entry.name}`),
252
- ...additionalExcludedPaths
253
- ];
249
+ const clientFiles = await (0, import_tinyglobby.glob)("**/*", {
250
+ cwd: clientDir,
251
+ // We can't exclude entire directories because there could be `foo/bar.baz` in the
252
+ // client dir and a `/foo` route handled by the server function.
253
+ onlyFiles: true,
254
+ dot: true
255
+ });
256
+ const excludedPath = ["/.netlify/*", ...clientFiles.map((file) => `/${file}`), ...additionalExcludedPaths];
254
257
  const edgeFunctionsDir = (0, import_node_path.join)(resolvedConfig.root, NETLIFY_EDGE_FUNCTIONS_DIR);
255
258
  await (0, import_promises.mkdir)(edgeFunctionsDir, { recursive: true });
256
259
  const relativeHandlerPath = toPosixPath((0, import_node_path.relative)(edgeFunctionsDir, handlerPath));
package/dist/index.mjs CHANGED
@@ -5,13 +5,14 @@ import {
5
5
  import "./chunk-J5PMA2AP.mjs";
6
6
 
7
7
  // src/plugin.ts
8
- import { mkdir, writeFile, readdir } from "node:fs/promises";
8
+ import { mkdir, writeFile } from "node:fs/promises";
9
9
  import { dirname, join, relative, resolve, sep } from "node:path";
10
10
  import { sep as posixSep } from "node:path/posix";
11
+ import { glob } from "tinyglobby";
11
12
 
12
13
  // package.json
13
14
  var name = "@netlify/vite-plugin-react-router";
14
- var version = "2.1.1";
15
+ var version = "2.1.2";
15
16
 
16
17
  // src/plugin.ts
17
18
  var NETLIFY_FUNCTIONS_DIR = ".netlify/v1/functions";
@@ -144,12 +145,14 @@ function netlifyPlugin(options = {}) {
144
145
  const handlerPath = join(resolvedConfig.build.outDir, `${FUNCTION_HANDLER_CHUNK}.js`);
145
146
  if (edge) {
146
147
  const clientDir = join(resolvedConfig.build.outDir, "..", "client");
147
- const entries = await readdir(clientDir, { withFileTypes: true });
148
- const excludedPath = [
149
- "/.netlify/*",
150
- ...entries.map((entry) => entry.isDirectory() ? `/${entry.name}/*` : `/${entry.name}`),
151
- ...additionalExcludedPaths
152
- ];
148
+ const clientFiles = await glob("**/*", {
149
+ cwd: clientDir,
150
+ // We can't exclude entire directories because there could be `foo/bar.baz` in the
151
+ // client dir and a `/foo` route handled by the server function.
152
+ onlyFiles: true,
153
+ dot: true
154
+ });
155
+ const excludedPath = ["/.netlify/*", ...clientFiles.map((file) => `/${file}`), ...additionalExcludedPaths];
153
156
  const edgeFunctionsDir = join(resolvedConfig.root, NETLIFY_EDGE_FUNCTIONS_DIR);
154
157
  await mkdir(edgeFunctionsDir, { recursive: true });
155
158
  const relativeHandlerPath = toPosixPath(relative(edgeFunctionsDir, handlerPath));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/vite-plugin-react-router",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "React Router 7+ Vite plugin for Netlify",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
@@ -54,7 +54,8 @@
54
54
  "dependencies": {
55
55
  "@netlify/edge-functions": "^3.0.2",
56
56
  "@netlify/functions": "^5.1.0",
57
- "isbot": "^5.1.25"
57
+ "isbot": "^5.1.25",
58
+ "tinyglobby": "^0.2.10"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@types/react": "^18.0.27",