Skip to content

Commit

Permalink
fix: fix the path in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangmo8 committed Mar 25, 2024
1 parent c3476ac commit 2f8a036
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cwd } from 'node:process'
import { addComponentsDir, addImports, createResolver, defineNuxtModule } from '@nuxt/kit'
import type { Nuxt } from '@nuxt/schema'
import { createUnplugin } from 'unplugin'
Expand All @@ -13,8 +14,9 @@ const functionComponentReg = new RegExp(functional.join('|'), 'g')

const directiveReg = new RegExp(`_resolveDirective\\(\\"(${directives.join('|')})\\"\\)`, 'g')

const CMD = cwd()
const { resolve } = createResolver(import.meta.url)
const relativePath = resolve(`../node_modules/${moduleName}`)
const relativePath = resolve(CMD, `node_modules/${moduleName}`)

function matchComponentName(componentStr: string): string {
const componentName = componentStr.replace(/_component_(v|V)ar(|_)+/, '').replaceAll('_', '-')
Expand Down

0 comments on commit 2f8a036

Please sign in to comment.