fix(packages): use ES modules for primary build (#11120)

This commit is contained in:
Miško Hevery
2016-08-30 18:07:40 -07:00
committed by Victor Berchet
parent 8cb1046ce9
commit 979657989b
249 changed files with 1929 additions and 1463 deletions

View File

@ -6,8 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
export * from './src/pipes';
export * from './src/directives';
export * from './src/location';
export {NgLocalization} from './src/localization';
export {CommonModule} from './src/common_module';
/**
* @module
* @description
* Entry point for all public APIs of the common package.
*/
export * from './src/common';
// This file only reexports content of the `src` folder. Keep it that way.

View File

@ -2,8 +2,8 @@
"name": "@angular/common",
"version": "0.0.0-PLACEHOLDER",
"description": "",
"main": "index.js",
"jsnext:main": "esm/index.js",
"main": "bundles/common.umd.js",
"module": "index.js",
"typings": "index.d.ts",
"author": "angular",
"license": "MIT",

View File

@ -0,0 +1,15 @@
export default {
entry: '../../../dist/packages-dist/common/testing/index.js',
dest: '../../../dist/packages-dist/common/bundles/common-testing.umd.js',
format: 'umd',
moduleName: 'ng.common.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'rxjs/Subject': 'Rx',
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx'
}
}

View File

@ -1,7 +1,7 @@
export default {
entry: '../../../dist/packages-dist/common/esm/index.js',
dest: '../../../dist/packages-dist/common/esm/common.umd.js',
entry: '../../../dist/packages-dist/common/index.js',
dest: '../../../dist/packages-dist/common/bundles/common.umd.js',
format: 'umd',
moduleName: 'ng.common',
globals: {
@ -10,8 +10,5 @@ export default {
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx'
},
plugins: [
// nodeResolve({ jsnext: true, main: true }),
]
}
}

View File

@ -6,5 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
export {SpyLocation} from './testing/location_mock';
export {MockLocationStrategy} from './testing/mock_location_strategy';
export * from './pipes';
export * from './directives';
export * from './location';
export {NgLocalization} from './localization';
export {CommonModule} from './common_module';

View File

@ -0,0 +1 @@
../../facade/src

View 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 common/testing package.
*/
export {SpyLocation} from './location_mock';
export {MockLocationStrategy} from './mock_location_strategy';

View File

@ -6,11 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Location, LocationStrategy} from '@angular/common';
import {EventEmitter, Injectable} from '@angular/core';
import {Location} from '../index';
import {LocationStrategy} from '../src/location/location_strategy';
/**
* A spy for {@link Location} that allows tests to fire simulated location events.

View File

@ -6,10 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Injectable} from '@angular/core';
import {LocationStrategy} from '../index';
import {EventEmitter} from '../src/facade/async';
import {LocationStrategy} from '@angular/common';
import {EventEmitter, Injectable} from '@angular/core';

View File

@ -4,21 +4,22 @@
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"module": "commonjs",
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/common/",
"paths": {
"@angular/core": ["../../../dist/packages-dist/core/"]
"@angular/core": ["../../../dist/packages-dist/core/"],
"@angular/common": ["../../../dist/packages-dist/common"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es6", "dom"],
"target": "es5"
"target": "es5",
"skipLibCheck": true
},
"files": [
"index.ts",
"testing.ts",
"testing/index.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
],
"angularCompilerOptions": {

View File

@ -6,18 +6,19 @@
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/common/esm",
"outDir": "../../../dist/packages-dist/common",
"paths": {
"@angular/core": ["../../../dist/packages-dist/core"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es2015"
"target": "es5",
"skipLibCheck": true,
"lib": [ "es2015", "dom" ]
},
"files": [
"index.ts",
"testing.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
],
"angularCompilerOptions": {