Skip to content

Commit

Permalink
fix(resolver:idux): update resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
danranVm committed May 12, 2022
1 parent 849e8c9 commit 386efee
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/core/resolvers/idux.ts
Expand Up @@ -6,12 +6,14 @@ const specialComponents: Record<string, string> = {
IxAutoComplete: 'auto-complete',
IxBackTop: 'back-top',
IxDatePicker: 'date-picker',
IxDateRangePicker: 'date-picker',
IxCol: 'grid',
IxRow: 'grid',
IxInputNumber: 'input-number',
IxTab: 'tabs',
IxTreeSelect: 'tree-select',
IxTimePicker: 'time-picker',
IxTimeRangePicker: 'time-picker',
}

export interface IduxResolverOptions {
Expand All @@ -32,7 +34,9 @@ export interface IduxResolverOptions {
*
* @link https://idux.site
*/
export function IduxResolver(options: IduxResolverOptions = {}): ComponentResolver {
export function IduxResolver(
options: IduxResolverOptions = {},
): ComponentResolver {
return {
type: 'component',
resolve: (name: string) => {
Expand All @@ -53,8 +57,11 @@ export function IduxResolver(options: IduxResolverOptions = {}): ComponentResolv
const path = `@idux/${packageName}/${dirname}`

let sideEffects: string | undefined
if (packageName !== 'cdk' && importStyle)
sideEffects = `${path}/style/themes/${importStyle === 'css' ? 'default_css' : 'default'}`
if (packageName !== 'cdk' && importStyle) {
sideEffects = `${path}/style/themes/${
importStyle === 'css' ? 'default_css' : 'default'
}`
}

return { name, from: path, sideEffects }
},
Expand Down

0 comments on commit 386efee

Please sign in to comment.