mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 01:15:58 +00:00
refactor: update internal modules signature(#2610)
This commit is contained in:
parent
70fe5e72e6
commit
11becef735
@ -17,10 +17,12 @@ Nuxt provides helper functions (accessed from `@nuxt/kit`) to assist in creating
|
||||
import { defineNuxtModule } from '@nuxt/kit'
|
||||
|
||||
export default defineNuxtModule({
|
||||
// The npm package name of your module
|
||||
name: '@nuxtjs/sample-module',
|
||||
// The key in `nuxt.config` that holds your module options
|
||||
configKey: 'sample',
|
||||
meta: {
|
||||
// The npm package name of your module
|
||||
name: '@nuxtjs/sample-module',
|
||||
// The key in `nuxt.config` that holds your module options
|
||||
configKey: 'sample',
|
||||
},
|
||||
// Default configuration options for your module
|
||||
defaults: {},
|
||||
hooks: {},
|
||||
|
@ -8,8 +8,10 @@ import { toExports, toImports } from './utils'
|
||||
import { AutoImportContext, createAutoImportContext, updateAutoImportContext } from './context'
|
||||
|
||||
export default defineNuxtModule<AutoImportsOptions>({
|
||||
name: 'auto-imports',
|
||||
configKey: 'autoImports',
|
||||
meta: {
|
||||
name: 'auto-imports',
|
||||
configKey: 'autoImports'
|
||||
},
|
||||
defaults: {
|
||||
sources: Nuxt3AutoImports,
|
||||
global: false,
|
||||
|
@ -10,8 +10,10 @@ const isPureObjectOrString = (val: any) => (!Array.isArray(val) && typeof val ==
|
||||
const isDirectory = (p: string) => { try { return statSync(p).isDirectory() } catch (_e) { return false } }
|
||||
|
||||
export default defineNuxtModule<ComponentsOptions>({
|
||||
name: 'components',
|
||||
configKey: 'components',
|
||||
meta: {
|
||||
name: 'components',
|
||||
configKey: 'components'
|
||||
},
|
||||
defaults: {
|
||||
dirs: ['~/components']
|
||||
},
|
||||
|
@ -5,7 +5,9 @@ import { distDir } from '../dirs'
|
||||
import type { MetaObject } from './runtime'
|
||||
|
||||
export default defineNuxtModule({
|
||||
name: 'meta',
|
||||
meta: {
|
||||
name: 'meta'
|
||||
},
|
||||
defaults: {
|
||||
charset: 'utf-8',
|
||||
viewport: 'width=device-width, initial-scale=1'
|
||||
|
@ -5,7 +5,9 @@ import { distDir } from '../dirs'
|
||||
import { resolveLayouts, resolvePagesRoutes, addComponentToRoutes } from './utils'
|
||||
|
||||
export default defineNuxtModule({
|
||||
name: 'router',
|
||||
meta: {
|
||||
name: 'router'
|
||||
},
|
||||
setup (_options, nuxt) {
|
||||
const pagesDir = resolve(nuxt.options.srcDir, nuxt.options.dir.pages)
|
||||
const runtimeDir = resolve(distDir, 'pages/runtime')
|
||||
|
Loading…
Reference in New Issue
Block a user