Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(bridge): disable legacy fetch polyfills #1866

Merged
merged 3 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions packages/bridge/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export function setupAppBridge (_options: any) {
nuxt.options.alias.vue2 = resolveModule('vue/dist/vue.runtime.esm.js', { paths: nuxt.options.modulesDir })
nuxt.options.build.transpile.push('vue')

// Disable legacy fetch polyfills
nuxt.options.fetch.server = false
nuxt.options.fetch.client = false

// Alias vue to have identical vue3 exports
nuxt.options.alias['vue2-bridge'] = resolve(distDir, 'runtime/vue2-bridge.mjs')
for (const alias of [
Expand Down
3 changes: 0 additions & 3 deletions packages/bridge/src/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export function setupNitroBridge () {
// @ts-ignore
nuxt.options.build.indicator = false

// Disable fetch polyfill (nitro provides it)
nuxt.options.fetch.server = false

// Create contexts
const nitroOptions = (nuxt.options as any).nitro || {}
const nitroContext = getNitroContext(nuxt.options, nitroOptions)
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
},
"devDependencies": {
"@nuxt/bridge": "*",
"core-js": "^3",
"nuxt": "^2",
"std-env": "^3.0.1",
"nuxt-edge": "latest",
"vue": "^2"
},
"installConfig": {
Expand Down
2 changes: 1 addition & 1 deletion test/presets/_tests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function setupTest (preset) {
before('nitro build', async function () {
this.timeout(60000)
const nuxtCLI = isBridge
? resolve(ctx.rootDir, 'node_modules/nuxt/bin/nuxt.js')
? resolve(ctx.rootDir, 'node_modules/nuxt-edge/bin/nuxt.js')
: resolveWorkspace('packages/nuxi/bin/nuxi.mjs')

await execa('node', [nuxtCLI, 'build', ctx.rootDir], {
Expand Down
Loading