mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(cli): 生成的entry文件不再在window挂对象,通过构建自动挂载
This commit is contained in:
parent
624da4c29a
commit
32fdf05eb1
@ -27,13 +27,11 @@ const generateContent = (type: EntryType, map: Record<string, string>, component
|
|||||||
});
|
});
|
||||||
|
|
||||||
const exportToken = `${type}s`;
|
const exportToken = `${type}s`;
|
||||||
const capitalToken = exportToken.charAt(0).toUpperCase() + exportToken.slice(1);
|
|
||||||
|
|
||||||
return prettyCode(`${importDeclarations.join(';')}
|
return prettyCode(`${importDeclarations.join(';')}
|
||||||
const ${exportToken}: Record<string, any> = {
|
const ${exportToken}: Record<string, any> = {
|
||||||
${list.join(',')}
|
${list.join(',')}
|
||||||
}
|
}
|
||||||
window.magicPreset${capitalToken} = ${exportToken};
|
|
||||||
export default ${exportToken};
|
export default ${exportToken};
|
||||||
`);
|
`);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user