feat(app): #537 auto install the module
This pull request is intended to install the module during the installation of the module Closes: #537
This commit is contained in:
parent
85b10641c2
commit
ba79c79453
|
|
@ -1,7 +1,7 @@
|
||||||
import { readFileSync, readdirSync } from 'node:fs'
|
import { readFileSync, readdirSync } from 'node:fs'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { parseSync } from '@oxc-parser/wasm'
|
import { parseSync } from '@oxc-parser/wasm'
|
||||||
import { addComponent, addTemplate, createResolver, defineNuxtModule, findPath, useLogger } from '@nuxt/kit'
|
import { addComponent, addTemplate, createResolver, defineNuxtModule, findPath, installModule, useLogger } from '@nuxt/kit'
|
||||||
import { UTILS } from '../../cli/src/utils/templates'
|
import { UTILS } from '../../cli/src/utils/templates'
|
||||||
|
|
||||||
// TODO: add test to make sure all registry is being parse correctly
|
// TODO: add test to make sure all registry is being parse correctly
|
||||||
|
|
@ -59,6 +59,14 @@ export default defineNuxtModule<ModuleOptions>({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Installs the `@nuxtjs/color-mode` module.
|
||||||
|
|
||||||
|
await installModule('@nuxtjs/color-mode', {
|
||||||
|
colorMode: {
|
||||||
|
classSuffix: '',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
// Manually scan `componentsDir` for components and register them for auto imports
|
// Manually scan `componentsDir` for components and register them for auto imports
|
||||||
try {
|
try {
|
||||||
readdirSync(resolve(COMPONENT_DIR_PATH))
|
readdirSync(resolve(COMPONENT_DIR_PATH))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user