mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
fix(nuxt3): default client-side fetch to use baseURL (#4456)
This commit is contained in:
parent
b82c6e3e96
commit
7b091abcea
@ -1,7 +1,7 @@
|
|||||||
// We set __webpack_public_path via this import with webpack builder
|
// We set __webpack_public_path via this import with webpack builder
|
||||||
import '#build/paths.mjs'
|
|
||||||
import { createSSRApp, createApp, nextTick } from 'vue'
|
import { createSSRApp, createApp, nextTick } from 'vue'
|
||||||
import { $fetch } from 'ohmyfetch'
|
import { $fetch } from 'ohmyfetch'
|
||||||
|
import { baseURL } from '#build/paths.mjs'
|
||||||
import { createNuxtApp, applyPlugins, normalizePlugins, CreateOptions } from '#app'
|
import { createNuxtApp, applyPlugins, normalizePlugins, CreateOptions } from '#app'
|
||||||
import '#build/css'
|
import '#build/css'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -12,7 +12,9 @@ import RootComponent from '#build/root-component.mjs'
|
|||||||
import AppComponent from '#build/app-component.mjs'
|
import AppComponent from '#build/app-component.mjs'
|
||||||
|
|
||||||
if (!globalThis.$fetch) {
|
if (!globalThis.$fetch) {
|
||||||
globalThis.$fetch = $fetch as any
|
globalThis.$fetch = $fetch.create({
|
||||||
|
baseURL: baseURL()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let entry: Function
|
let entry: Function
|
||||||
|
Loading…
Reference in New Issue
Block a user