Skip to content

Commit

Permalink
chroe: update
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Jun 24, 2024
1 parent e5240f1 commit d8ccbe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/core/resolvers/veui.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join, normalize } from 'node:path'
import { resolvePathSync } from 'mlly'
import type { ComponentResolver, SideEffectsInfo } from '../../types'
import { camelCase, kebabCase, pascalCase, resolveImportPath } from '../utils'
import { camelCase, kebabCase, pascalCase } from '../utils'

interface VeuiPeerConfig {
/**
Expand Down Expand Up @@ -109,7 +110,7 @@ const peerPaths = new Map<string, boolean>()
function assertPeerPath(peerPath: string) {
if (!peerPaths.has(peerPath)) {
try {
resolveImportPath(peerPath)
resolvePathSync(peerPath)
peerPaths.set(peerPath, true)
}
catch (e) {
Expand Down
5 changes: 0 additions & 5 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { parse } from 'node:path'
import process from 'node:process'
import { minimatch } from 'minimatch'
import { resolvePathSync } from 'mlly'
import { slash, toArray } from '@antfu/utils'
import {
getPackageInfo,
Expand Down Expand Up @@ -221,7 +220,3 @@ export function shouldTransform(code: string) {
return false
return true
}

export function resolveImportPath(importName: string): string | undefined {
return resolvePathSync(importName)
}

0 comments on commit d8ccbe1

Please sign in to comment.