mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-04-21 12:58:09 +00:00
31 lines
694 B
TypeScript
31 lines
694 B
TypeScript
import { COMMON_CHUNK_NAME } from '../../../const/generator';
|
|
|
|
import {
|
|
BuilderComponentPlugin,
|
|
BuilderComponentPluginFactory,
|
|
ChunkType,
|
|
FileType,
|
|
ICodeStruct,
|
|
} from '../../../types';
|
|
|
|
const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
|
|
const plugin: BuilderComponentPlugin = async (pre: ICodeStruct) => {
|
|
const next: ICodeStruct = {
|
|
...pre,
|
|
};
|
|
|
|
next.chunks.push({
|
|
type: ChunkType.STRING,
|
|
fileType: FileType.JSX,
|
|
name: COMMON_CHUNK_NAME.ExternalDepsImport,
|
|
content: `import { createElement, Component } from 'rax';`,
|
|
linkAfter: [],
|
|
});
|
|
|
|
return next;
|
|
};
|
|
return plugin;
|
|
};
|
|
|
|
export default pluginFactory;
|