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:
16
modules/@angular/platform-webworker/.babelrc
Normal file
16
modules/@angular/platform-webworker/.babelrc
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
{
|
||||
"presets": ["es2015"],
|
||||
"plugins": [["transform-es2015-modules-umd", {
|
||||
"globals": {
|
||||
"@angular/core": "ng.core",
|
||||
"@angular/common": "ng.common",
|
||||
"@angular/platform-browser": "ng.platformBrowser",
|
||||
"@angular/platform-webworker": "ng.platformWebworker",
|
||||
"rxjs/Observable": "Rx",
|
||||
"rxjs/Subject": "Rx"
|
||||
},
|
||||
"exactGlobals": true
|
||||
}]],
|
||||
"moduleId": "@angular/platform-webworker"
|
||||
}
|
@ -6,11 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Entry point for all public APIs of the platform-webworker package.
|
||||
*/
|
||||
export * from './src/platform-webworker';
|
||||
// This file is not used to build this module. It is only used during editing
|
||||
// by the TypeScript language service and during build for verification. `ngc`
|
||||
// replaces this file with production index.ts when it rewrites private symbol
|
||||
// names.
|
||||
|
||||
// This file only reexports content of the `src` folder. Keep it that way.
|
||||
export * from './public_api';
|
||||
|
@ -2,9 +2,10 @@
|
||||
"name": "@angular/platform-webworker",
|
||||
"version": "0.0.0-PLACEHOLDER",
|
||||
"description": "Angular - library for using Angular in a web browser with web workers",
|
||||
"main": "bundles/platform-webworker.umd.js",
|
||||
"module": "index.js",
|
||||
"typings": "index.d.ts",
|
||||
"main": "./bundles/platform-webworker.umd.js",
|
||||
"module": "./@angular/platform-webworker.es5.js",
|
||||
"es2015": "./@angular/platform-webworker.js",
|
||||
"typings": "./typings/platform-webworker.d.ts",
|
||||
"author": "angular",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
|
15
modules/@angular/platform-webworker/public_api.ts
Normal file
15
modules/@angular/platform-webworker/public_api.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Entry point for all public APIs of the platform-browser package.
|
||||
*/
|
||||
export * from './src/platform-webworker';
|
||||
// This file only reexports content of the `src` folder. Keep it that way.
|
@ -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-webworker/index.js',
|
||||
dest: '../../../dist/packages-dist/platform-webworker/bundles/platform-webworker.umd.js',
|
||||
format: 'umd',
|
||||
moduleName: 'ng.platformWebworker',
|
||||
globals: {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs/Observable': 'Rx',
|
||||
'rxjs/Subject': 'Rx'
|
||||
}
|
||||
};
|
@ -15,18 +15,20 @@
|
||||
"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
|
||||
"types": []
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"public_api.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"strictMetadataEmit": true
|
||||
"strictMetadataEmit": true,
|
||||
"bundleIndex": "index",
|
||||
"importAs": "@angular/platform-webworker"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user