build: publish tree of files rather than FESMs (#18541)

* Remove now unnecessary portions of build.
* Add a compilePackageES5 method to build ES5 from sources
* Rework all package.json and rollup config files to new format
* Remove "extends" from tsconfig-build.json files and fixup compilation roots

PR Close #18541
This commit is contained in:
Jason Aden
2017-08-02 19:15:30 -07:00
parent ee04217d53
commit fd701b07f0
160 changed files with 1079 additions and 892 deletions

View File

@ -3,8 +3,8 @@
"version": "0.0.0-PLACEHOLDER",
"description": "Angular - language services",
"main": "./bundles/language-service.umd.js",
"module": "./@angular/language-service.es5.js",
"typings": "./language-service.d.ts",
"module": "./esm5/index.js",
"typings": "./index.d.ts",
"author": "angular",
"license": "MIT",
"repository": {

View File

@ -7,6 +7,7 @@
*/
import commonjs from 'rollup-plugin-commonjs';
import sourcemaps from 'rollup-plugin-sourcemaps';
import * as path from 'path';
var m = /^\@angular\/((\w|\-)+)(\/(\w|\d|\/|\-)+)?$/;
@ -39,7 +40,8 @@ function resolve(id, from) {
var esm_suffix = esm_suffixes[packageName] || '';
var loc = locations[packageName] || location;
var r = loc !== location && (loc + esm_suffix + packageName + (match[3] || '/index') + '.js') ||
loc + packageName + '/@angular/' + packageName + '.es5.js';
loc + packageName + '/esm5/' +
'index.js';
// console.log('** ANGULAR MAPPED **: ', r);
return r;
}
@ -69,7 +71,7 @@ module.exports = function(provided) {
`;
export default {
entry: '../../dist/packages-dist/language-service/@angular/language-service.es5.js',
entry: '../../dist/packages-dist/language-service/esm5/index.js',
dest: '../../dist/packages-dist/language-service/bundles/language-service.umd.js',
format: 'amd',
moduleName: 'ng.language_service',
@ -85,5 +87,5 @@ export default {
'fs': 'fs',
},
banner: banner,
plugins: [{resolveId: resolve}, commonjs()]
plugins: [{resolveId: resolve}, commonjs(), sourcemaps()]
}

View File

@ -1,14 +1,10 @@
{
"extends": "../tsconfig-build.json",
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictNullChecks": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../dist/packages/language-service",
"baseUrl": ".",
"rootDir": ".",
"paths": {
"@angular/core": ["../../dist/packages/core"],
"@angular/animation": ["../../dist/packages/animation"],
@ -24,13 +20,9 @@
"@angular/tsc-wrapped": ["../../dist/packages-dist/tsc-wrapped"],
"@angular/tsc-wrapped/*": ["../../dist/packages-dist/tsc-wrapped/*"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"outDir": "../../dist/packages/language-service"
},
"files": [
"index.ts",
"../../node_modules/zone.js/dist/zone.js.d.ts",