father
father copied to clipboard
[lerna + rollup场景] 向上查找tsconfig.json不生效
https://github.com/umijs/father/blob/f1c9d330c98b8bf165de0ebbead050dba4272c50/packages/father-build/src/getRollupConfig.ts#L172 不应该设置tsconfig的初值,目前是给出tsconfig.json的默认路径,这样导致无法向上查找。
这里是typescript提供的findConfigFile的实现。
源码:
export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName = "tsconfig.json"): string | undefined {
return forEachAncestorDirectory(searchPath, ancestor => {
const fileName = combinePaths(ancestor, configName);
return fileExists(fileName) ? fileName : undefined;
});
}
https://github.com/umijs/father/blob/f1c9d330c98b8bf165de0ebbead050dba4272c50/packages/father-build/src/getRollupConfig.ts#L172
不应该设置tsconfig的初值,目前是给出tsconfig.json的默认路径,这样导致无法向上查找。 这里是typescript提供的findConfigFile的实现。
源码:
export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName = "tsconfig.json"): string | undefined { return forEachAncestorDirectory(searchPath, ancestor => { const fileName = combinePaths(ancestor, configName); return fileExists(fileName) ? fileName : undefined; }); }
我也有这个问题,啥时候能解决一下,但是umi好像没问题
话说package
的package.json
文件要注意些什么,我用yarn create umi
创建的包可以正常build
,用lerna create XX
创建的build
就会报错。
father 4 已发布,可尝试升级到最新版:https://github.com/umijs/father/blob/master/docs/guide/migrate.md
旧版本不再维护,感谢支持