Skip to content

Commit 6d61712

Browse files
fengxiaodong28sxzz
andauthored
feat(idux): add scope supports (unplugin#507)
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
1 parent f6da6af commit 6d61712

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/core/resolvers/idux.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ export interface IduxResolverOptions {
3333
* @default 'default'
3434
*/
3535
importStyleTheme?: string
36+
37+
/**
38+
* The scope of the packages.
39+
*
40+
* @default '@idux'
41+
*/
42+
scope?: string
3643
}
3744

3845
/**
@@ -44,7 +51,7 @@ export function IduxResolver(options: IduxResolverOptions = {}): ComponentResolv
4451
return {
4552
type: 'component',
4653
resolve: (name: string) => {
47-
const { importStyle, importStyleTheme = 'default', exclude = [] } = options
54+
const { importStyle, importStyleTheme = 'default', exclude = [], scope = '@idux' } = options
4855
if (exclude.includes(name))
4956
return
5057

@@ -58,7 +65,7 @@ export function IduxResolver(options: IduxResolverOptions = {}): ComponentResolv
5865
dirname = kebabCase(name).split('-')[nameIndex]
5966
}
6067

61-
const path = `@idux/${packageName}/${dirname}`
68+
const path = `${scope}/${packageName}/${dirname}`
6269

6370
let sideEffects: string | undefined
6471
if (packageName !== 'cdk' && importStyle)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy