Skip to content

Commit

Permalink
fix(tdesign): resolver (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn authored Apr 2, 2022
1 parent 76a2a07 commit 443b39a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/resolvers/tdesign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getSideEffects(importName: string, options: TDesignResolverOptions): Si

if (fileName.includes('-') && fileName !== 'input-number') {
const prefix = fileName.slice(0, fileName.indexOf('-'))
const container = ['anchor', 'avatar', 'breadcrumb', 'checkbox', 'dropdown', 'form', 'input', 'list', 'menu', 'radio', 'slider', 'steps', 'swiper']
const container = ['anchor', 'avatar', 'breadcrumb', 'checkbox', 'dropdown', 'form', 'input', 'list', 'menu', 'radio', 'slider', 'swiper']

if (container.includes(prefix))
fileName = prefix
Expand All @@ -57,12 +57,18 @@ function getSideEffects(importName: string, options: TDesignResolverOptions): Si
if (['tab-nav', 'tab-panel'].includes(fileName))
fileName = 'tabs'

if (fileName === 'step-item')
fileName = 'steps'

if (fileName === 'check-tag')
fileName = 'tag'

if (fileName === 'time-range-picker')
fileName = 'time-picker'

if (fileName === 'date-range-picker')
fileName = 'date-picker'

if (importStyle === 'less')
return `tdesign-${library}/esm/${fileName}/style`

Expand Down

0 comments on commit 443b39a

Please sign in to comment.