perf: distrubute smaller bundled code and include es2015 bundle

TypeScript compiler will now build to ES2015 code and modules. Babili is used to minify ES2015
code, providing an initial optimization that we couldn't previously get just from Uglify. Uses
Babel to convert ES2015 to UMD/ES5 code, and Uglify to minimize the output.
This commit is contained in:
Jason Aden
2017-01-27 17:39:48 -08:00
committed by Igor Minar
parent 738d93caf7
commit de795ea233
175 changed files with 2515 additions and 1246 deletions

View File

@ -0,0 +1,13 @@
{
"presets": ["es2015"],
"plugins": [["transform-es2015-modules-umd", {
"globals": {
"@angular/core": "ng.core",
"rxjs/Subject": "Rx"
},
"exactGlobals": true
}]],
"moduleId": "@angular/core"
}

View File

@ -2,9 +2,10 @@
"name": "@angular/core",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular - the core framework",
"main": "bundles/core.umd.js",
"module": "index.js",
"typings": "index.d.ts",
"main": "./bundles/core.umd.js",
"module": "./@angular/core.es5.js",
"es2015": "./@angular/core.js",
"typings": "./typings/core.d.ts",
"author": "angular",
"license": "MIT",
"peerDependencies": {

View File

@ -1,19 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/core/testing/index.js',
dest: '../../../dist/packages-dist/core/bundles/core-testing.umd.js',
format: 'umd',
moduleName: 'ng.core.testing',
globals: {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
}
};

View File

@ -1,18 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export default {
entry: '../../../dist/packages-dist/core/index.js',
dest: '../../../dist/packages-dist/core/bundles/core.umd.js',
format: 'umd',
moduleName: 'ng.core',
globals: {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
}
};

View File

@ -6,9 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
import * as view_utils from './linker/view_utils';
import * as viewEngine from './view/index';
export {AnimationGroupPlayer as ɵAnimationGroupPlayer} from './animation/animation_group_player';
export {AnimationKeyframe as ɵAnimationKeyframe} from './animation/animation_keyframe';
export {NoOpAnimationPlayer as ɵNoOpAnimationPlayer} from './animation/animation_player';
@ -28,5 +25,5 @@ export {AppView as ɵAppView, DebugAppView as ɵDebugAppView} from './linker/vie
export {ViewContainer as ɵViewContainer} from './linker/view_container';
export {ViewType as ɵViewType} from './linker/view_type';
export {reflector as ɵreflector} from './reflection/reflection';
export {view_utils as ɵview_utils};
export {viewEngine as ɵviewEngine};
export {ViewUtils as ɵViewUtils, checkBinding as ɵcheckBinding, checkBindingChange as ɵcheckBindingChange, checkRenderText as ɵcheckRenderText, checkRenderProperty as ɵcheckRenderProperty, checkRenderAttribute as ɵcheckRenderAttribute, checkRenderClass as ɵcheckRenderClass, checkRenderStyle as ɵcheckRenderStyle, inlineInterpolate as ɵinlineInterpolate, interpolate as ɵinterpolate, castByValue as ɵcastByValue, EMPTY_ARRAY as ɵEMPTY_ARRAY, EMPTY_MAP as ɵEMPTY_MAP, createRenderElement as ɵcreateRenderElement, selectOrCreateRenderHostElement as ɵselectOrCreateRenderHostElement, pureProxy1 as ɵpureProxy1, pureProxy2 as ɵpureProxy2, pureProxy3 as ɵpureProxy3, pureProxy4 as ɵpureProxy4, pureProxy5 as ɵpureProxy5, pureProxy6 as ɵpureProxy6, pureProxy7 as ɵpureProxy7, pureProxy8 as ɵpureProxy8, pureProxy9 as ɵpureProxy9, pureProxy10 as ɵpureProxy10, noop as ɵnoop, setBindingDebugInfo as ɵsetBindingDebugInfo, setBindingDebugInfoForChanges as ɵsetBindingDebugInfoForChanges, InlineArray2 as ɵInlineArray2, InlineArray4 as ɵInlineArray4, InlineArray8 as ɵInlineArray8, InlineArray16 as ɵInlineArray16, EMPTY_INLINE_ARRAY as ɵEMPTY_INLINE_ARRAY, InlineArrayDynamic as ɵInlineArrayDynamic, subscribeToRenderElement as ɵsubscribeToRenderElement, createRenderComponentType as ɵcreateRenderComponentType, getComponentFactoryViewClass as ɵgetComponentFactoryViewClass} from './linker/view_utils';
export {viewDef as ɵviewDef, elementDef as ɵelementDef, anchorDef as ɵanchorDef, textDef as ɵtextDef, directiveDef as ɵdirectiveDef, providerDef as ɵproviderDef, queryDef as ɵqueryDef, pureArrayDef as ɵpureArrayDef, pureObjectDef as ɵpureObjectDef, purePipeDef as ɵpurePipeDef, pipeDef as ɵpipeDef, nodeValue as ɵnodeValue, ngContentDef as ɵngContentDef, unwrapValue as ɵunwrapValue, NodeFlags as ɵNodeFlags, ViewFlags as ɵViewFlags, elementEventFullName as ɵelementEventFullName, QueryValueType as ɵQueryValueType, QueryBindingType as ɵQueryBindingType, ProviderType as ɵProviderType, BindingType as ɵBindingType, ArgumentType as ɵArgumentType, DepFlags as ɵDepFlags, createComponentFactory as ɵcreateComponentFactory, createRendererTypeV2 as ɵcreateRendererTypeV2} from './view/index';

View File

@ -16,6 +16,6 @@ export * from './async';
export * from './component_fixture';
export * from './fake_async';
export * from './test_bed';
export * from './testing';
export * from './before_each';
export * from './metadata_override';
export * from './private_export_testing';

View File

@ -13,7 +13,7 @@
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"target": "es2015",
"lib": ["es2015", "dom"],
"skipLibCheck": true,
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output

View File

@ -2,6 +2,7 @@
"extends": "./tsconfig-build",
"compilerOptions": {
"outDir": "../../../dist/packages-dist/core",
"paths": {
"rxjs/*": ["../../../node_modules/rxjs/*"],
"@angular/core": ["../../../dist/packages-dist/core"]