|
1 | 1 | import { IncomingMessage, request } from "node:http"; |
| 2 | +import { resolve } from "node:path"; |
2 | 3 |
|
3 | 4 | import { getFreePort, integrationTest, readAppmaps, spawnAppmapNode } from "./helpers"; |
4 | 5 |
|
| 6 | +const nextBin = require.resolve("next/dist/bin/next", { |
| 7 | + paths: [resolve(__dirname, "next16")], |
| 8 | +}); |
| 9 | + |
5 | 10 | async function spawnNextJsApp(port: number) { |
6 | 11 | // On Windows, we give "node" argument explicitly because next is a js file with |
7 | 12 | // shebang (#!/usr/bin/env node) which does not work on Windows. |
8 | 13 | // Turbopack (the default bundler in Next.js 16) respects webpack loaders configured |
9 | 14 | // via next.config turbopack.rules, which we inject in src/hooks/next.ts. |
10 | 15 | const app = |
11 | 16 | process.platform == "win32" |
12 | | - ? spawnAppmapNode("node", "node_modules\\next\\dist\\bin\\next", "dev", "-p", String(port)) |
13 | | - : spawnAppmapNode("node_modules/next/dist/bin/next", "dev", "-p", String(port)); |
| 17 | + ? spawnAppmapNode("node", nextBin, "dev", "-p", String(port)) |
| 18 | + : spawnAppmapNode(nextBin, "dev", "-p", String(port)); |
14 | 19 |
|
15 | 20 | await new Promise<void>((r) => { |
16 | 21 | const onData = (chunk: Buffer) => { |
|
0 commit comments