Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/popular-candles-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/aws": major
---

fix(middleware): copy wasm files for bundled middleware
6 changes: 4 additions & 2 deletions packages/open-next/src/build/createMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from "node:fs";

Check failure on line 1 in packages/open-next/src/build/createMiddleware.ts

View workflow job for this annotation

GitHub Actions / validate

format

File content differs from formatting output
import path from "node:path";

import {
Expand All @@ -7,7 +7,7 @@
} from "config/util.js";
import logger from "../logger.js";
import type { MiddlewareInfo } from "../types/next-types.js";
import { buildEdgeBundle } from "./edge/createEdgeBundle.js";
import { buildEdgeBundle, copyMiddlewareResources } from "./edge/createEdgeBundle.js";
import * as buildHelper from "./helper.js";
import { installDependencies } from "./installDeps.js";
import {
Expand Down Expand Up @@ -51,8 +51,10 @@
}
}

const outputPath = path.join(outputDir, "middleware");
copyMiddlewareResources(options, edgeMiddlewareInfo, outputPath);

if (config.middleware?.external) {
const outputPath = path.join(outputDir, "middleware");
fs.mkdirSync(outputPath, { recursive: true });

// Copy open-next.config.mjs
Expand Down
Loading