本文整理汇总了TypeScript中canonical-path.join函数的典型用法代码示例。如果您正苦于以下问题:TypeScript join函数的具体用法?TypeScript join怎么用?TypeScript join使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了join函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: updatePackageJson
protected updatePackageJson(
entryPoint: EntryPoint, formatProperty: EntryPointJsonProperty, newDir: AbsoluteFsPath) {
const bundlePath = entryPoint.packageJson[formatProperty] !;
const newBundlePath = relative(entryPoint.path, join(newDir, bundlePath));
(entryPoint.packageJson as any)[formatProperty + '_ivy_ngcc'] = newBundlePath;
writeFileSync(join(entryPoint.path, 'package.json'), JSON.stringify(entryPoint.packageJson));
}
开发者ID:alxhub,项目名称:angular,代码行数:7,代码来源:new_entry_point_file_writer.ts
示例2: writeBundle
writeBundle(entryPoint: EntryPoint, bundle: EntryPointBundle, transformedFiles: FileInfo[]) {
// The new folder is at the root of the overall package
const relativeEntryPointPath = relative(entryPoint.package, entryPoint.path);
const relativeNewDir = join(NGCC_DIRECTORY, relativeEntryPointPath);
const newDir = AbsoluteFsPath.fromUnchecked(join(entryPoint.package, relativeNewDir));
this.copyBundle(bundle, entryPoint.path, newDir);
transformedFiles.forEach(file => this.writeFile(file, entryPoint.path, newDir));
this.updatePackageJson(entryPoint, bundle.formatProperty, newDir);
}
开发者ID:alxhub,项目名称:angular,代码行数:9,代码来源:new_entry_point_file_writer.ts
示例3: relative
bundle.src.program.getSourceFiles().forEach(sourceFile => {
if (!sourceFile.isDeclarationFile) {
const relativePath = relative(entryPointPath, sourceFile.fileName);
const newFilePath = join(newDir, relativePath);
mkdir('-p', dirname(newFilePath));
cp(sourceFile.fileName, newFilePath);
}
});
开发者ID:alxhub,项目名称:angular,代码行数:8,代码来源:new_entry_point_file_writer.ts
示例4: writeFile
protected writeFile(file: FileInfo, entryPointPath: AbsoluteFsPath, newDir: AbsoluteFsPath):
void {
if (isDtsPath(file.path.replace(/\.map$/, ''))) {
// This is either `.d.ts` or `.d.ts.map` file
super.writeFileAndBackup(file);
} else {
const relativePath = relative(entryPointPath, file.path);
const newFilePath = join(newDir, relativePath);
mkdir('-p', dirname(newFilePath));
writeFileSync(newFilePath, file.contents, 'utf8');
}
}
开发者ID:alxhub,项目名称:angular,代码行数:12,代码来源:new_entry_point_file_writer.ts
示例5:
.forEach(p => {
// Either the directory is a potential package or a namespace containing packages (e.g
// `@angular`).
const packagePath = path.join(sourceDirectory, p);
if (p.startsWith('@')) {
entryPoints.push(...walkDirectoryForEntryPoints(packagePath));
} else {
entryPoints.push(...getEntryPointsForPackage(packagePath));
// Also check for any nested node_modules in this package
const nestedNodeModulesPath = path.resolve(packagePath, 'node_modules');
if (fs.existsSync(nestedNodeModulesPath)) {
entryPoints.push(...walkDirectoryForEntryPoints(nestedNodeModulesPath));
}
}
});
开发者ID:KaneFreeman,项目名称:angular,代码行数:16,代码来源:entry_point_finder.ts
示例6:
(from: string, importPath: string) => path.join('/internal', importPath + '.js'));
开发者ID:KaneFreeman,项目名称:angular,代码行数:1,代码来源:dependency_host_spec.ts
注:本文中的canonical-path.join函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论