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:
15
modules/@angular/platform-browser-dynamic/.babelrc
Normal file
15
modules/@angular/platform-browser-dynamic/.babelrc
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": [["transform-es2015-modules-umd", {
|
||||
"globals": {
|
||||
"@angular/core": "ng.core",
|
||||
"@angular/common": "ng.common",
|
||||
"@angular/compiler": "ng.compiler",
|
||||
"@angular/platform-browser": "ng.platformBrowser",
|
||||
"@angular/platform-browser-dynamic": "ng.platformBrowserDynamic"
|
||||
},
|
||||
"exactGlobals": true
|
||||
}]],
|
||||
"moduleId": "@angular/platform-browser-dynamic"
|
||||
}
|
19
modules/@angular/platform-browser-dynamic/.babelrc-testing
Normal file
19
modules/@angular/platform-browser-dynamic/.babelrc-testing
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": [["transform-es2015-modules-umd", {
|
||||
"globals": {
|
||||
"@angular/core": "ng.core",
|
||||
"@angular/core/testing": "ng.core.testing",
|
||||
"@angular/common": "ng.common",
|
||||
"@angular/compiler": "ng.compiler",
|
||||
"@angular/compiler/testing": "ng.compiler.testing",
|
||||
"@angular/platform-browser": "ng.platformBrowser",
|
||||
"@angular/platform-browser/testing": "ng.platformBrowser.testing",
|
||||
"@angular/platform-browser-dynamic": "ng.platformBrowserDynamic",
|
||||
"@angular/platform-browser-dynamic/testing": "ng.platformBrowserDynamic.testing"
|
||||
},
|
||||
"exactGlobals": true
|
||||
}]],
|
||||
"moduleId": "@angular/platform-browser-dynamic/testing"
|
||||
}
|
@ -2,9 +2,10 @@
|
||||
"name": "@angular/platform-browser-dynamic",
|
||||
"version": "0.0.0-PLACEHOLDER",
|
||||
"description": "Angular - library for using Angular in a web browser with JIT compilation",
|
||||
"main": "bundles/platform-browser-dynamic.umd.js",
|
||||
"module": "index.js",
|
||||
"typings": "index.d.ts",
|
||||
"main": "./bundles/platform-browser-dynamic.umd.js",
|
||||
"module": "./@angular/platform-browser-dynamic.es5.js",
|
||||
"es2015": "./@angular/platform-browser-dynamic.js",
|
||||
"typings": "./typings/platform-browser-dynamic.d.ts",
|
||||
"author": "angular",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
|
@ -1,25 +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/platform-browser-dynamic/testing/index.js',
|
||||
dest:
|
||||
'../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
format: 'umd',
|
||||
moduleName: 'ng.platformBrowserDynamic.testing',
|
||||
globals: {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/core/testing': 'ng.core.testing',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/compiler/testing': 'ng.compiler.testing',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'@angular/platform-browser/testing': 'ng.platformBrowser.testing',
|
||||
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic'
|
||||
}
|
||||
};
|
@ -1,21 +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/platform-browser-dynamic/index.js',
|
||||
dest:
|
||||
'../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
format: 'umd',
|
||||
moduleName: 'ng.platformBrowserDynamic',
|
||||
globals: {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
}
|
||||
};
|
@ -20,7 +20,7 @@
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"target": "es5",
|
||||
"target": "es2015",
|
||||
"skipLibCheck": true,
|
||||
"lib": ["es2015", "dom"],
|
||||
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig-build",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../dist/packages-dist/platform-browser-dynamic",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
|
Reference in New Issue
Block a user