mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-17 02:00:02 +08:00
fix(cli): 插件不支持ts的问题
This commit is contained in:
parent
328b3135e5
commit
ccb4e675ab
@ -63,7 +63,7 @@ export const resolveAppPackages = (app: App): ModuleMainFilePath => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const indexCode = fs.readFileSync(i.indexPath, { encoding: 'utf-8', flag: 'r' });
|
const indexCode = fs.readFileSync(i.indexPath, { encoding: 'utf-8', flag: 'r' });
|
||||||
const ast = recast.parse(indexCode);
|
const ast = recast.parse(indexCode, { parser: require('recast/parsers/typescript') });
|
||||||
if (typeAssertion({ ast, indexPath }).type === PackageType.PLUGIN) {
|
if (typeAssertion({ ast, indexPath }).type === PackageType.PLUGIN) {
|
||||||
// 插件
|
// 插件
|
||||||
pluginMap[i.type] = i.indexPath;
|
pluginMap[i.type] = i.indexPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user