mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
27 lines
534 B
TypeScript
27 lines
534 B
TypeScript
import { REACT_CHUNK_NAME } from './const';
|
|
|
|
import {
|
|
BuilderComponentPlugin,
|
|
ChunkType,
|
|
FileType,
|
|
ICodeStruct,
|
|
} from '../../../types';
|
|
|
|
const plugin: BuilderComponentPlugin = async (pre: ICodeStruct) => {
|
|
const next: ICodeStruct = {
|
|
...pre,
|
|
};
|
|
|
|
next.chunks.push({
|
|
type: ChunkType.STRING,
|
|
fileType: FileType.JSX,
|
|
name: REACT_CHUNK_NAME.ClassConstructorContent,
|
|
content: `this.utils = utils;`,
|
|
linkAfter: [REACT_CHUNK_NAME.ClassConstructorStart],
|
|
});
|
|
|
|
return next;
|
|
};
|
|
|
|
export default plugin;
|