Skip to content

Commit 2b6b0fc

Browse files
authored
refactor!: remove legacy fetch support (#3198)
1 parent 002a09d commit 2b6b0fc

File tree

8 files changed

+2
-42
lines changed

8 files changed

+2
-42
lines changed

docs/3.config/0.index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ If enabled, will analyze server bundle after build using [rollup-plugin-visualiz
549549

550550
### `moduleSideEffects`
551551

552-
Default: `['unenv/polyfill/', 'node-fetch-native/polyfill']`
552+
Default: `['unenv/polyfill/']`
553553

554554
Rollup specific option. Specifies module imports that have side-effects
555555

lib/runtime-meta.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const runtimeDependencies = [
1414
"hookable",
1515
"iron-webcrypto",
1616
"klona",
17-
"node-fetch-native",
1817
"node-mock-http",
1918
"ofetch",
2019
"ohash",

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
"magicast": "^0.3.5",
9393
"mime": "^4.0.6",
9494
"mlly": "^1.7.4",
95-
"node-fetch-native": "^1.6.6",
9695
"node-mock-http": "^1.0.0",
9796
"ofetch": "^1.4.1",
9897
"ohash": "^2.0.11",

pnpm-lock.yaml

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/config/defaults.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ export const NitroDefaults: NitroConfig = {
7272

7373
// Rollup
7474
analyze: false,
75-
moduleSideEffects: [
76-
"unenv/polyfill/",
77-
"node-fetch-native/polyfill",
78-
"node-fetch-native/dist/polyfill",
79-
resolve(runtimeDir, "polyfill/"),
80-
],
75+
moduleSideEffects: ["unenv/polyfill/", resolve(runtimeDir, "polyfill/")],
8176
replace: {},
8277
node: true,
8378
sourceMap: true,

src/core/config/loader.ts

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
} from "./resolvers/compatibility";
2020
import { resolveDatabaseOptions } from "./resolvers/database";
2121
import { resolveExportConditionsOptions } from "./resolvers/export-conditions";
22-
import { resolveFetchOptions } from "./resolvers/fetch";
2322
import { resolveImportsOptions } from "./resolvers/imports";
2423
import { resolveOpenAPIOptions } from "./resolvers/open-api";
2524
import { resolvePathOptions } from "./resolvers/paths";
@@ -36,7 +35,6 @@ const configResolvers = [
3635
resolveImportsOptions,
3736
resolveRouteRulesOptions,
3837
resolveDatabaseOptions,
39-
resolveFetchOptions,
4038
resolveExportConditionsOptions,
4139
resolveRuntimeConfigOptions,
4240
resolveOpenAPIOptions,

src/core/config/resolvers/fetch.ts

-24
This file was deleted.

src/types/config.ts

-4
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ export interface NitroOptions extends PresetOptions {
108108
* Disable Experimental Sourcemap Minification
109109
*/
110110
sourcemapMinify?: false;
111-
/**
112-
* Backward compatibility support for Node fetch (required for Node < 18)
113-
*/
114-
nodeFetchCompat?: boolean;
115111
/**
116112
* Allow env expansion in runtime config
117113
*

0 commit comments

Comments
 (0)