Skip to content

Commit e6e3fe4

Browse files
authored
feat(arco): new option sideEffect (#338)
1 parent b7d8bb7 commit e6e3fe4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/core/resolvers/arco.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ export interface ArcoResolverOptions {
143143
* @default false
144144
*/
145145
resolveIcons?: boolean
146+
/**
147+
* Control style automatic import
148+
*
149+
* @default true
150+
*/
151+
sideEffect?: boolean
146152
}
147153

148154
/**
@@ -170,11 +176,14 @@ export function ArcoResolver(
170176
const importStyle = options.importStyle ?? 'css'
171177

172178
const importName = name.slice(1)
173-
return {
179+
const config = {
174180
importName,
175181
path: '@arco-design/web-vue',
176-
sideEffects: getComponentStyleDir(importName, importStyle),
177182
}
183+
if (options.sideEffect !== false) {
184+
(config as any).sideEffects = getComponentStyleDir(importName, importStyle)
185+
}
186+
return config
178187
}
179188
},
180189
}

0 commit comments

Comments
 (0)