|
1 |
| -import { Config } from "../config"; |
2 |
| -import { build, Plugin } from "esbuild"; |
3 |
| -import { existsSync, readFileSync } from "node:fs"; |
| 1 | +import { Plugin, build } from "esbuild"; |
4 | 2 | import { cp, readFile, writeFile } from "node:fs/promises";
|
5 |
| -import path from "node:path"; |
6 |
| -import { fileURLToPath } from "node:url"; |
7 |
| - |
8 |
| -import { patchRequire } from "./patches/investigated/patch-require"; |
| 3 | +import { existsSync, readFileSync } from "node:fs"; |
| 4 | +import { Config } from "../config"; |
9 | 5 | import { copyPackageCliFiles } from "./patches/investigated/copy-package-cli-files";
|
10 |
| - |
11 |
| -import { patchReadFile } from "./patches/to-investigate/patch-read-file"; |
12 |
| -import { patchFindDir } from "./patches/to-investigate/patch-find-dir"; |
13 |
| -import { inlineNextRequire } from "./patches/to-investigate/inline-next-require"; |
| 6 | +import { fileURLToPath } from "node:url"; |
14 | 7 | import { inlineEvalManifest } from "./patches/to-investigate/inline-eval-manifest";
|
| 8 | +import { inlineNextRequire } from "./patches/to-investigate/inline-next-require"; |
| 9 | +import { patchCache } from "./patches/investigated/patch-cache"; |
| 10 | +import { patchFindDir } from "./patches/to-investigate/patch-find-dir"; |
| 11 | +import { patchReadFile } from "./patches/to-investigate/patch-read-file"; |
| 12 | +import { patchRequire } from "./patches/investigated/patch-require"; |
15 | 13 | import { patchWranglerDeps } from "./patches/to-investigate/wrangler-deps";
|
| 14 | +import path from "node:path"; |
16 | 15 | import { updateWebpackChunksFile } from "./patches/investigated/update-webpack-chunks-file";
|
17 |
| -import { patchCache } from "./patches/investigated/patch-cache"; |
18 | 16 |
|
19 | 17 | /** The dist directory of the Cloudflare adapter package */
|
20 | 18 | const packageDistDir = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
@@ -177,10 +175,10 @@ function createFixRequiresESBuildPlugin(templateDir: string): Plugin {
|
177 | 175 | name: "replaceRelative",
|
178 | 176 | setup(build) {
|
179 | 177 | // Note: we (empty) shim require-hook modules as they generate problematic code that uses requires
|
180 |
| - build.onResolve({ filter: /^\.\/require-hook$/ }, (args) => ({ |
| 178 | + build.onResolve({ filter: /^\.\/require-hook$/ }, () => ({ |
181 | 179 | path: path.join(templateDir, "shims", "empty.ts"),
|
182 | 180 | }));
|
183 |
| - build.onResolve({ filter: /\.\/lib\/node-fs-methods$/ }, (args) => ({ |
| 181 | + build.onResolve({ filter: /\.\/lib\/node-fs-methods$/ }, () => ({ |
184 | 182 | path: path.join(templateDir, "shims", "empty.ts"),
|
185 | 183 | }));
|
186 | 184 | },
|
|
0 commit comments