build中一个路径计算的错误
This commit is contained in:
parent
07c00f3b29
commit
dfac402f87
|
|
@ -352,7 +352,8 @@ function analyzeEntity(filename, path, program, relativePath) {
|
|||
*/
|
||||
var moduleSpecifier = node.moduleSpecifier, importClause = node.importClause;
|
||||
if (ts.isStringLiteral(moduleSpecifier) && !moduleSpecifier.text.startsWith(env_1.LIB_OAK_DOMAIN)) {
|
||||
var moduleSpecifier2Text = relativePath ? path_1.default.join(relativePath, '..', moduleSpecifier.text) : path_1.default.join('..', moduleSpecifier.text);
|
||||
// 编译后的路径默认要深一层
|
||||
var moduleSpecifier2Text = relativePath ? path_1.default.join(relativePath, moduleSpecifier.text) : path_1.default.join('..', moduleSpecifier.text);
|
||||
additionalImports.push(factory.updateImportDeclaration(node, undefined, undefined, importClause, factory.createStringLiteral(moduleSpecifier2Text), undefined));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -512,7 +512,8 @@ function analyzeEntity(filename: string, path: string, program: ts.Program, rela
|
|||
*/
|
||||
const { moduleSpecifier, importClause } = node;
|
||||
if (ts.isStringLiteral(moduleSpecifier) && !moduleSpecifier.text.startsWith(LIB_OAK_DOMAIN)) {
|
||||
const moduleSpecifier2Text = relativePath ? PathLib.join(relativePath, '..', moduleSpecifier.text) : PathLib.join('..', moduleSpecifier.text);
|
||||
// 编译后的路径默认要深一层
|
||||
const moduleSpecifier2Text = relativePath ? PathLib.join(relativePath, moduleSpecifier.text) : PathLib.join('..', moduleSpecifier.text);
|
||||
additionalImports.push(
|
||||
factory.updateImportDeclaration(
|
||||
node,
|
||||
|
|
|
|||
Loading…
Reference in New Issue