Composition API hooks for Nuxt 2.
MIT License
Bot releases are hidden (Show)
Published by danielroe over 3 years ago
package exports have been moved
see https://github.com/nuxt-community/composition-api/pull/480 for context
output .mjs
files for runtime templates
(outside of Nuxt) only auto-registers plugin if NODE_ENV == 'test'
Published by danielroe over 3 years ago
@nuxtjs/composition-api/module
is now how the module should be imported in nuxt.config
There is no longer a need to amend moduleNameMapper
in your jest.config - you should remove any entry for @nuxtjs/composition-api
there. When used outside a Nuxt context, the module will 'auto-mock' and use https://github.com/nuxt-community/composition-api/blob/be94d4f4e1321565864dd3d3d5e850f7cabf6ca9/src/globals.ts instead of live Nuxt configuration.
@nuxtjs/composition-api/babel
has been renamed to @nuxtjs/composition-api/dist/babel-plugin
.
@vue/composition-api
is no longer transpiled by default. You should consider adding it to build.transpile
, but note that you may also need to add any other libraries that also use @vue/composition-api
.
You should ensure you haven't named any layout '0' as this will conflict with how this package is registering the Vue Composition API.
defineNuxtConfig
, defineNuxtModule
and defineNuxtServerMiddleware
have been removed. You can create your own helper with the following code:
import { Module, ServerMiddleware, NuxtConfig } from '@nuxt/types'
export const defineNuxtModule = <T extends Record<string, unknown>>(module: Module<T>) => module
export const defineNuxtServerMiddleware = (serverMiddleware: ServerMiddleware) => serverMiddleware
export const defineNuxtConfig = (config: NuxtConfig) => config
from
rather than redirectedFrom
from useContext
(a159d87), closes #444
nuxt-vite
compatbility.mjs
(but we polyfill support for this and other .mjs
files in webpack 4).node_modules
rather than being templated, with a limited template for the config.Published by danielroe over 3 years ago
Published by danielroe over 3 years ago
defineNuxtConfig
helper (6484e97)useRoute
, useRouter
and useStore
wrapper functions (80e6c08)wrapProperty
helper information (bc0e091)static-json
path with custom router base or cdnURL (fca527e), closes #351
static-json
folder before dev/build (27e2ffa), closes #337
defineNuxtConfig
is accessible within config file (06500ab)