Compare commits

...

2 Commits

Author SHA1 Message Date
LeoYuan 袁力皓
cea84cc40c chore(release): code-generator - 1.1.3-beta.0 2023-05-19 11:24:44 +08:00
LeoYuan 袁力皓
c8397e7b2c fix: add Fusion-UI style for code generation 2023-05-19 11:23:05 +08:00
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@alilc/lowcode-code-generator", "name": "@alilc/lowcode-code-generator",
"version": "1.1.2", "version": "1.1.3-beta.0",
"description": "出码引擎 for LowCode Engine", "description": "出码引擎 for LowCode Engine",
"license": "MIT", "license": "MIT",
"main": "lib/index.js", "main": "lib/index.js",

View File

@ -21,6 +21,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
if (ir && ir.deps && ir.deps.length > 0) { if (ir && ir.deps && ir.deps.length > 0) {
let lowcodeMaterialsStyleAdded = false; let lowcodeMaterialsStyleAdded = false;
let fusionUIStyleAdded = false;
let nextStyleAddedMap: Record<string, boolean> = {}; let nextStyleAddedMap: Record<string, boolean> = {};
ir.deps.forEach((dep: any) => { ir.deps.forEach((dep: any) => {
if (dep.package === '@alifd/next' && !nextStyleAddedMap[dep.exportName]) { if (dep.package === '@alifd/next' && !nextStyleAddedMap[dep.exportName]) {
@ -41,6 +42,15 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
linkAfter: [COMMON_CHUNK_NAME.ExternalDepsImport], linkAfter: [COMMON_CHUNK_NAME.ExternalDepsImport],
}); });
lowcodeMaterialsStyleAdded = true; lowcodeMaterialsStyleAdded = true;
} else if (dep.package === '@alifd/fusion-ui' && !fusionUIStyleAdded) {
chunks.push({
type: ChunkType.STRING,
fileType: FileType.JSX,
name: COMMON_CHUNK_NAME.InternalDepsImport,
content: 'import \'@alifd/fusion-ui/lib/style\';',
linkAfter: [COMMON_CHUNK_NAME.ExternalDepsImport],
});
fusionUIStyleAdded = true;
} }
}); });
} }