Skip to content

Commit fa5168b

Browse files
LeoYuanliujuping
authored andcommitted
fix: add Fusion-UI style for code generation
1 parent be4b164 commit fa5168b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/code-generator/src/plugins/common/styleImport.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
2121

2222
if (ir && ir.deps && ir.deps.length > 0) {
2323
let lowcodeMaterialsStyleAdded = false;
24+
let fusionUIStyleAdded = false;
2425
let nextStyleAddedMap: Record<string, boolean> = {};
2526
ir.deps.forEach((dep: any) => {
2627
if (dep.package === '@alifd/next' && !nextStyleAddedMap[dep.exportName]) {
@@ -41,6 +42,15 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
4142
linkAfter: [COMMON_CHUNK_NAME.ExternalDepsImport],
4243
});
4344
lowcodeMaterialsStyleAdded = true;
45+
} else if (dep.package === '@alifd/fusion-ui' && !fusionUIStyleAdded) {
46+
chunks.push({
47+
type: ChunkType.STRING,
48+
fileType: FileType.JSX,
49+
name: COMMON_CHUNK_NAME.InternalDepsImport,
50+
content: 'import \'@alifd/fusion-ui/lib/style\';',
51+
linkAfter: [COMMON_CHUNK_NAME.ExternalDepsImport],
52+
});
53+
fusionUIStyleAdded = true;
4454
}
4555
});
4656
}

0 commit comments

Comments
 (0)