@@ -10,7 +10,6 @@ let addLicenseToFile = licenseTool.addLicenseToFile;
1010let addLicenseTextToFile = licenseTool . addLicenseTextToFile ;
1111let makePackages = require ( './.make-helpers' ) ;
1212let copySources = makePackages . copySources ;
13- let createImportTargets = makePackages . createImportTargets ;
1413let cleanSourceMapRoot = makePackages . cleanSourceMapRoot ;
1514let bo = null ;
1615// Build Optimizer is not available on Node 4.x. Using a try/catch
@@ -27,9 +26,7 @@ const ESM5_ROOT = ROOT + 'esm5/';
2726const ESM2015_ROOT = ROOT + 'esm2015/' ;
2827const UMD_ROOT = ROOT + 'global/' ;
2928const ESM5_FOR_ROLLUP_ROOT = ROOT + 'esm5_for_rollup/' ;
30- const LEGACY_REEXPORT_ROOT = ROOT + 'legacy-reexport/' ;
3129const TYPE_ROOT = ROOT + 'typings/' ;
32- const MIGRATION_PKG = ROOT + 'migrations/' ;
3330const PKG_ROOT = ROOT + 'package/' ;
3431const CJS_PKG = PKG_ROOT + '' ;
3532const ESM5_PKG = PKG_ROOT + '_esm5/' ;
@@ -75,50 +72,13 @@ klawSync(ESM5_ROOT, {
7572 return fileName ;
7673} ) ;
7774
78- /**
79- * Get a list of the file names. Sort in reverse order so re-export files
80- * such as "operators.js" are AFTER their more specfic exports, such as
81- * "operators/map.js". This is due to a Webpack bug for node-resolved imports
82- * (rxjs/operators resolves to rxjs/operators.js), Webpack's "alias"
83- * functionality requires that the most broad mapping (rxjs/operators) be at
84- * the end of the alias mapping object. Created Webpack issue:
85- * https://github.com/webpack/webpack/issues/5870
86- *
87- * This is only needed for items in legacy-reexport as others should be resolved
88- * through their package.json.
89- */
90- const fileNames = klawSync ( LEGACY_REEXPORT_ROOT , {
91- nodir : true ,
92- filter : function ( item ) {
93- return item . path . endsWith ( '.js' ) ;
94- }
95- } )
96- . map ( item => item . path )
97- . map ( path => path . slice ( ( `${ __dirname } /${ LEGACY_REEXPORT_ROOT } ` ) . length ) )
98- . sort ( ) . reverse ( ) ;
99-
100- // Create an object hash mapping imports to file names
101- const importTargets = fileNames . reduce ( ( acc , fileName ) => {
102- // Get the name of the file to be the new directory
103- const directory = fileName . slice ( 0 , fileName . length - 3 ) ;
104-
105- acc [ directory ] = fileName ;
106- return acc ;
107- } , { } ) ;
108-
109- createImportTargets ( importTargets , "_esm5/" , ESM5_PKG ) ;
110- createImportTargets ( importTargets , "_esm2015/" , ESM2015_PKG ) ;
111-
11275// Make the distribution folder
11376mkdirp . sync ( PKG_ROOT ) ;
11477
11578// Copy over the sources
11679copySources ( 'src/' , SRC_ROOT_PKG ) ;
117- // Copy legacy-reexport sources
118- copySources ( 'legacy-reexport/' , SRC_ROOT_PKG ) ;
11980
12081copySources ( CJS_ROOT , CJS_PKG ) ;
121- fs . copySync ( LEGACY_REEXPORT_ROOT , CJS_PKG , { overwrite : false , errorOnExist : true } ) ;
12282
12383// Clean up the source maps for CJS sources
12484cleanSourceMapRoot ( PKG_ROOT , SRC_ROOT_PKG ) ;
@@ -137,11 +97,6 @@ fs.copySync('src/operators/package.json', PKG_ROOT + '/operators/package.json');
13797fs . copySync ( 'src/ajax/package.json' , PKG_ROOT + '/ajax/package.json' ) ;
13898fs . copySync ( 'src/webSocket/package.json' , PKG_ROOT + '/webSocket/package.json' ) ;
13999fs . copySync ( 'src/testing/package.json' , PKG_ROOT + '/testing/package.json' ) ;
140- fs . copySync ( 'src/internal-compatibility/package.json' , PKG_ROOT + '/internal-compatibility/package.json' ) ;
141-
142- // Copy over migrations
143- fs . copySync ( MIGRATION_PKG , PKG_ROOT + 'migrations/' ) ;
144- fs . copySync ( './migrations/collection.json' , PKG_ROOT + 'migrations/collection.json' ) ;
145100
146101if ( fs . existsSync ( UMD_ROOT ) ) {
147102 fs . copySync ( UMD_ROOT , UMD_PKG ) ;
0 commit comments