mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +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 () {
|
||||
const { nuxt } = this
|
||||
return nuxt2(nuxt)
|
||||
return nuxt2(nuxt, this)
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { getsigmaContext, SigmaContext } from '../context'
|
||||
import { createDevServer } from '../server'
|
||||
import wpfs from '../utils/wpfs'
|
||||
|
||||
export default function (nuxt) {
|
||||
export default function (nuxt, moduleContainer) {
|
||||
// Build in node_modules/.cache/nuxt
|
||||
const oldBuildDir = nuxt.options.buildDir
|
||||
nuxt.options.buildDir = resolve(nuxt.options.rootDir, 'node_modules/.cache/nuxt')
|
||||
@ -33,6 +33,12 @@ export default function (nuxt) {
|
||||
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
|
||||
// TODO: render:setupMiddleware hook
|
||||
// TODO: support m.prefix and m.route
|
||||
|
Loading…
Reference in New Issue
Block a user