feat(ivy): compile all package formats in ngcc (#25406)
PR Close #25406
This commit is contained in:
parent
7d3b70c2af
commit
68acc5b355
|
@ -4,7 +4,7 @@ set -x
|
|||
|
||||
PATH=$PATH:$(npm bin)
|
||||
|
||||
ivy-ngcc node_modules/@angular/common esm2015
|
||||
ivy-ngcc node_modules/@angular/common
|
||||
cp -r node_modules_ngtsc/* node_modules/
|
||||
ngc -p tsconfig-app.json
|
||||
|
||||
|
|
|
@ -9,14 +9,19 @@ import {resolve} from 'path';
|
|||
import {PackageTransformer} from './transform/package_transformer';
|
||||
|
||||
export function mainNgcc(args: string[]): number {
|
||||
const packagePath = resolve(args[0]);
|
||||
const format = args[1] || 'fesm2015';
|
||||
const packagePaths = args[0] ? [resolve(args[0])] : [];
|
||||
const formats = args[1] ? [args[1]] : ['fesm2015', 'esm2015', 'fesm5', 'esm5'];
|
||||
|
||||
// TODO: find all the package types to transform
|
||||
// TODO: error/warning logging/handling etc
|
||||
|
||||
const transformer = new PackageTransformer();
|
||||
transformer.transform(packagePath, format);
|
||||
packagePaths.forEach(packagePath => {
|
||||
formats.forEach(format => {
|
||||
console.warn(`Compiling ${packagePath}:${format}`);
|
||||
transformer.transform(packagePath, format);
|
||||
});
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue