11import { join } from 'path' ;
2- import { DIST_BUNDLES , DIST_ROOT , SOURCE_ROOT , PROJECT_ROOT } from '../build-config' ;
32import { copyFiles } from '../util/copy-files' ;
43import { addPureAnnotationsToFile } from './pure-annotations' ;
54import { updatePackageVersion } from './package-versions' ;
65import { inlinePackageMetadataFiles } from './metadata-inlining' ;
76import { createTypingsReexportFile } from './typings-reexport' ;
87import { createMetadataReexportFile } from './metadata-reexport' ;
8+ import { buildConfig } from './build-config' ;
9+
10+ const { packagesDir, outputDir, projectDir} = buildConfig ;
11+
12+ /** Directory where all bundles will be created in. */
13+ const bundlesDir = join ( outputDir , 'bundles' ) ;
914
1015/**
1116 * Copies different output files into a folder structure that follows the `angular/angular`
@@ -14,17 +19,17 @@ import {createMetadataReexportFile} from './metadata-reexport';
1419 */
1520export function composeRelease ( packageName : string ) {
1621 // To avoid refactoring of the project the package material will map to the source path `lib/`.
17- const sourcePath = join ( SOURCE_ROOT , packageName === 'material' ? 'lib' : packageName ) ;
18- const packagePath = join ( DIST_ROOT , 'packages' , packageName ) ;
19- const releasePath = join ( DIST_ROOT , 'releases' , packageName ) ;
22+ const sourcePath = join ( packagesDir , packageName === 'material' ? 'lib' : packageName ) ;
23+ const packagePath = join ( outputDir , 'packages' , packageName ) ;
24+ const releasePath = join ( outputDir , 'releases' , packageName ) ;
2025
2126 inlinePackageMetadataFiles ( packagePath ) ;
2227
2328 copyFiles ( packagePath , '**/*.+(d.ts|metadata.json)' , join ( releasePath , 'typings' ) ) ;
24- copyFiles ( DIST_BUNDLES , `${ packageName } .umd?(.min).js?(.map)` , join ( releasePath , 'bundles' ) ) ;
25- copyFiles ( DIST_BUNDLES , `${ packageName } ?(.es5).js?(.map)` , join ( releasePath , '@angular' ) ) ;
26- copyFiles ( PROJECT_ROOT , 'LICENSE' , releasePath ) ;
27- copyFiles ( SOURCE_ROOT , 'README.md' , releasePath ) ;
29+ copyFiles ( bundlesDir , `${ packageName } .umd?(.min).js?(.map)` , join ( releasePath , 'bundles' ) ) ;
30+ copyFiles ( bundlesDir , `${ packageName } ?(.es5).js?(.map)` , join ( releasePath , '@angular' ) ) ;
31+ copyFiles ( projectDir , 'LICENSE' , releasePath ) ;
32+ copyFiles ( packagesDir , 'README.md' , releasePath ) ;
2833 copyFiles ( sourcePath , 'package.json' , releasePath ) ;
2934
3035 updatePackageVersion ( releasePath ) ;
0 commit comments