fix: put all ngc
files into a single directory (#10486)
Prior to this change `ngc` would place generated files which refer to components in the node_modules into the node_module. This is an issue. Now all of the files are forced into a single directory as specified in `tsconfig.json` by the `genDir` option. see: https://docs.google.com/document/d/1OgP1RIpZ-lWUc4113J3w13HTDcW-1-0o7TuGz0tGx0g
This commit is contained in:
@ -80,7 +80,14 @@ export class CodeGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
return path.join(this.options.genDir, path.relative(root, filePath));
|
||||
// transplant the codegen path to be inside the `genDir`
|
||||
var relativePath: string = path.relative(root, filePath);
|
||||
while (relativePath.startsWith('..' + path.sep)) {
|
||||
// Strip out any `..` path such as: `../node_modules/@foo` as we want to put everything
|
||||
// into `genDir`.
|
||||
relativePath = relativePath.substr(3);
|
||||
}
|
||||
return path.join(this.options.genDir, relativePath);
|
||||
}
|
||||
|
||||
codegen(): Promise<any> {
|
||||
|
Reference in New Issue
Block a user