mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
feat: add $fetch to client
This commit is contained in:
parent
d3d3c0a2ea
commit
a7d158798c
@ -2,5 +2,5 @@ import nuxt2 from './module/nuxt2'
|
|||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const { nuxt } = this
|
const { nuxt } = this
|
||||||
return nuxt2(nuxt)
|
return nuxt2(nuxt, this)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import { getsigmaContext, SigmaContext } from '../context'
|
|||||||
import { createDevServer } from '../server'
|
import { createDevServer } from '../server'
|
||||||
import wpfs from '../utils/wpfs'
|
import wpfs from '../utils/wpfs'
|
||||||
|
|
||||||
export default function (nuxt) {
|
export default function (nuxt, moduleContainer) {
|
||||||
// Build in node_modules/.cache/nuxt
|
// Build in node_modules/.cache/nuxt
|
||||||
const oldBuildDir = nuxt.options.buildDir
|
const oldBuildDir = nuxt.options.buildDir
|
||||||
nuxt.options.buildDir = resolve(nuxt.options.rootDir, 'node_modules/.cache/nuxt')
|
nuxt.options.buildDir = resolve(nuxt.options.rootDir, 'node_modules/.cache/nuxt')
|
||||||
@ -33,6 +33,12 @@ export default function (nuxt) {
|
|||||||
nuxt.server = createNuxt2DevServer(sigmaDevContext)
|
nuxt.server = createNuxt2DevServer(sigmaDevContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $fetch support in client
|
||||||
|
moduleContainer.addPlugin({
|
||||||
|
fileName: 'fetch.client.js',
|
||||||
|
src: resolve(sigmaContext._internal.runtimeDir, 'app/fetch.client.js')
|
||||||
|
})
|
||||||
|
|
||||||
// serverMiddleware bridge
|
// serverMiddleware bridge
|
||||||
// TODO: render:setupMiddleware hook
|
// TODO: render:setupMiddleware hook
|
||||||
// TODO: support m.prefix and m.route
|
// TODO: support m.prefix and m.route
|
||||||
|
Loading…
Reference in New Issue
Block a user