File tree Expand file tree Collapse file tree 10 files changed +2134
-2766
lines changed
Expand file tree Collapse file tree 10 files changed +2134
-2766
lines changed Original file line number Diff line number Diff line change 3838 "vant" : " >=4"
3939 },
4040 "dependencies" : {
41- "@nuxt/kit" : " ^3.12.2 " ,
41+ "@nuxt/kit" : " ^3.14.159 " ,
4242 "magic-string" : " ^0.29.0" ,
43- "unplugin" : " ^1.10.2 "
43+ "unplugin" : " ^1.16.0 "
4444 },
4545 "devDependencies" : {
4646 "@nuxt/module-builder" : " ^0.5.5" ,
47- "@nuxt/schema" : " ^3.12.2 " ,
47+ "@nuxt/schema" : " ^3.14.159 " ,
4848 "@nuxtjs/eslint-config-typescript" : " ^12.1.0" ,
49- "@types/node" : " ^18.19.39 " ,
50- "eslint" : " ^8.57.0 " ,
51- "nuxt" : " ^3.12.2 " ,
52- "typescript" : " ^5.5.2 " ,
53- "vant" : " ^4.9.1 " ,
54- "vue" : " ^3.4.31 "
49+ "@types/node" : " ^22.9.0 " ,
50+ "eslint" : " ^8.57.1 " ,
51+ "nuxt" : " ^3.14.159 " ,
52+ "typescript" : " ^5.6.3 " ,
53+ "vant" : " ^4.9.8 " ,
54+ "vue" : " ^3.5.12 "
5555 },
5656 "publishConfig" : {
5757 "access" : " public" ,
Original file line number Diff line number Diff line change 11import { defineNuxtConfig } from 'nuxt/config'
2- import Vant from '..'
2+ import Vant from '../src/module '
33
44export default defineNuxtConfig ( {
55 modules : [ Vant ] ,
Original file line number Diff line number Diff line change 11import AllComponents from 'vant'
2- import type { Options , PresetImport } from './types'
2+ import type { ModuleOptions , PresetImport } from './types'
33
44export const libraryName = 'vant'
55
@@ -47,7 +47,7 @@ const defaultExclude: RegExp[] = [
4747 / [ \\ / ] \. n u x t [ \\ / ] /
4848]
4949
50- export const defaults : Options = {
50+ export const defaults : ModuleOptions = {
5151 lazyload : false ,
5252 importStyle : true ,
5353 components : allComponents ,
Original file line number Diff line number Diff line change 11import { addComponent , createResolver } from '@nuxt/kit'
22import { libraryName } from '../config'
33import { hyphenate , toArray } from '../utils'
4- import type { Options } from '../types'
4+ import type { ModuleOptions } from '../types'
55
6- export function resolveComponents ( config : Options ) {
6+ export function resolveComponents ( config : ModuleOptions ) {
77 const { components, excludeExports } = config
88 const { resolvePath } = createResolver ( import . meta. url )
99
Original file line number Diff line number Diff line change 11import { addImportsSources } from '@nuxt/kit'
22import { libraryName } from '../config'
3- import type { Options } from '../types'
3+ import type { ModuleOptions } from '../types'
44
5- export function resolveImports ( config : Options ) {
5+ export function resolveImports ( config : ModuleOptions ) {
66 const { imports } = config
77
88 addImportsSources ( {
Original file line number Diff line number Diff line change 11import { libraryName } from '../config'
22import { isObject } from '../utils'
3- import type { Options } from '../types'
3+ import type { ModuleOptions } from '../types'
44
5- export function resolveLazyload ( config : Options ) {
5+ export function resolveLazyload ( config : ModuleOptions ) {
66 const { lazyload } = config
77 const options = isObject ( lazyload ) ? `, ${ JSON . stringify ( lazyload ) } ` : ''
88
Original file line number Diff line number Diff line change 11import { allImportsWithStyle , libraryName } from '../config'
22import { hyphenate } from '../utils'
3- import type { Options } from '../types'
3+ import type { ModuleOptions } from '../types'
44
55export function getStyleDir ( name : string ) {
66 return `${ libraryName } /es/${ hyphenate ( name ) } /style/index.mjs`
77}
88
9- export function resolveStyles ( config : Options , name : string ) {
9+ export function resolveStyles ( config : ModuleOptions , name : string ) {
1010 const { components, importStyle } = config
1111
1212 if ( importStyle === false ) { return undefined }
Original file line number Diff line number Diff line change @@ -9,17 +9,16 @@ import {
99 localePlugin ,
1010 transformPlugin
1111} from './core/index'
12- import type { Options } from './types'
12+ import type { ModuleOptions } from './types'
13+ export type { ModuleOptions } from './types'
1314
14- export default defineNuxtModule < Partial < Options > > ( {
15+ export default defineNuxtModule < ModuleOptions > ( {
1516 meta : {
1617 name : libraryName ,
1718 configKey : libraryName
1819 } ,
1920 defaults,
20- setup ( _options , nuxt ) {
21- const options = _options as Options
22-
21+ setup ( options , nuxt ) {
2322 resolveOptions ( )
2423 nuxt . options . imports . autoImport !== false && resolveImports ( options )
2524 nuxt . options . components !== false && resolveComponents ( options )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export interface TransformOptions {
77 exclude : RegExp [ ]
88}
99
10- export interface Options extends TransformOptions {
10+ export interface ModuleOptions extends TransformOptions {
1111 /**
1212 * Whether to automatically load lazyload directives and components.
1313 *
@@ -49,12 +49,3 @@ export interface Options extends TransformOptions {
4949 */
5050 imports : PresetImport [ ]
5151}
52-
53- declare module '@nuxt/schema' {
54- interface NuxtConfig {
55- vant ?: Partial < Options >
56- }
57- interface NuxtOptions {
58- vant ?: Partial < Options >
59- }
60- }
You can’t perform that action at this time.
0 commit comments