Skip to content

Commit

Permalink
feat: processing path for lays
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangmo8 committed Mar 25, 2024
1 parent 1e4d626 commit 577df5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 31 deletions.
36 changes: 10 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { join } from 'node:path'
import { addComponentsDir, addImports, defineNuxtModule } from '@nuxt/kit'
import { addComponentsDir, addImports, createResolver, defineNuxtModule } from '@nuxt/kit'
import type { Nuxt } from '@nuxt/schema'
import { createUnplugin } from 'unplugin'
import MagicString from 'magic-string'
Expand All @@ -14,9 +13,8 @@ const functionComponentReg = new RegExp(functional.join('|'), 'g')

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

// eslint-disable-next-line node/prefer-global/process
const CMD = process.cwd()
const relativePath = join(CMD, `node_modules/${moduleName}`)
const { resolve } = createResolver(import.meta.url)
const relativePath = resolve(`../node_modules/${moduleName}`)

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

0 comments on commit 577df5d

Please sign in to comment.