Skip to content

Commit 1ae56e5

Browse files
author
Nicolas Dorseuil
committed
review fix
1 parent 2cef4fb commit 1ae56e5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.changeset/popular-candles-watch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"@opennextjs/aws": major
2+
"@opennextjs/aws": patch
33
---
44

5-
fix(middleware): copy wasm files for bundled middleware
5+
fix(middleware): copy wasm files for the external middleware

packages/open-next/src/build/createMiddleware.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
} from "config/util.js";
88
import logger from "../logger.js";
99
import type { MiddlewareInfo } from "../types/next-types.js";
10-
import { buildEdgeBundle, copyMiddlewareResources } from "./edge/createEdgeBundle.js";
10+
import {
11+
buildEdgeBundle,
12+
copyMiddlewareResources,
13+
} from "./edge/createEdgeBundle.js";
1114
import * as buildHelper from "./helper.js";
1215
import { installDependencies } from "./installDeps.js";
1316
import {
@@ -51,10 +54,10 @@ export async function createMiddleware(
5154
}
5255
}
5356

54-
const outputPath = path.join(outputDir, "middleware");
55-
copyMiddlewareResources(options, edgeMiddlewareInfo, outputPath);
56-
5757
if (config.middleware?.external) {
58+
const outputPath = path.join(outputDir, "middleware");
59+
copyMiddlewareResources(options, edgeMiddlewareInfo, outputPath);
60+
5861
fs.mkdirSync(outputPath, { recursive: true });
5962

6063
// Copy open-next.config.mjs

0 commit comments

Comments
 (0)