Skip to content

Commit

Permalink
build: add node resolve strat to rollup and adjust config
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonaden committed May 19, 2017
1 parent aafb01c commit 8ce481a
Show file tree
Hide file tree
Showing 27 changed files with 355 additions and 200 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"rho": "^0.3.0",
"rollup": "^0.41.6",
"rollup-plugin-commonjs": "^5.0.5",
"rollup-plugin-node-resolve": "^3.0.0",
"selenium-webdriver": "^2.53.3",
"semver": "^5.1.0",
"sorcery": "^0.10.0",
Expand Down
16 changes: 11 additions & 5 deletions packages/animations/browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/animations': 'ng.animations'
};

export default {
entry: '../../../dist/packages-dist/animations/@angular/animations/browser.es5.js',
dest: '../../../dist/packages-dist/animations/bundles/animations-browser.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.animations.browser',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/animations': 'ng.animations'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
16 changes: 11 additions & 5 deletions packages/animations/browser/testing/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
};

export default {
entry: '../../../../dist/packages-dist/animations/@angular/animations/browser/testing.es5.js',
dest: '../../../../dist/packages-dist/animations/bundles/animations-browser-testing.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.animations.browser.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/animations': 'ng.animations'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
16 changes: 11 additions & 5 deletions packages/animations/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
};

export default {
entry: '../../dist/packages-dist/animations/@angular/animations.es5.js',
dest: '../../dist/packages-dist/animations/bundles/animations.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.animations',
globals: {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
16 changes: 11 additions & 5 deletions packages/common/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
};

export default {
entry: '../../dist/packages-dist/common/@angular/common.es5.js',
dest: '../../dist/packages-dist/common/bundles/common.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.common',
globals: {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
18 changes: 12 additions & 6 deletions packages/common/testing/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
};

export default {
entry: '../../../dist/packages-dist/common/@angular/common/testing.es5.js',
dest: '../../../dist/packages-dist/common/bundles/common-testing.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.common.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
19 changes: 11 additions & 8 deletions packages/compiler/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
};

export default {
entry: '../../dist/packages-dist/compiler/@angular/compiler.es5.js',
dest: '../../dist/packages-dist/compiler/bundles/compiler.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.compiler',
globals: {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
},
plugins: [
// nodeResolve({ jsnext: true, main: true }),
]
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
20 changes: 13 additions & 7 deletions packages/compiler/testing/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'@angular/core/testing': 'ng.core.testing',
'@angular/compiler': 'ng.compiler',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
};

export default {
entry: '../../../dist/packages-dist/compiler/@angular/compiler/testing.es5.js',
dest: '../../../dist/packages-dist/compiler/bundles/compiler-testing.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.compiler.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/core/testing': 'ng.core.testing',
'@angular/compiler': 'ng.compiler',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
22 changes: 14 additions & 8 deletions packages/core/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/Observer': 'Rx',
'rxjs/Subscription': 'Rx',
'rxjs/observable/merge': 'Rx.Observable',
'rxjs/operator/share': 'Rx.Observable.prototype'
};

export default {
entry: '../../dist/packages-dist/core/@angular/core.es5.js',
dest: '../../dist/packages-dist/core/bundles/core.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.core',
globals: {
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/Observer': 'Rx',
'rxjs/Subscription': 'Rx',
'rxjs/observable/merge': 'Rx.Observable',
'rxjs/operator/share': 'Rx.Observable.prototype'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
16 changes: 11 additions & 5 deletions packages/core/testing/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
};

export default {
entry: '../../../dist/packages-dist/core/@angular/core/testing.es5.js',
dest: '../../../dist/packages-dist/core/bundles/core-testing.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.core.testing',
globals: {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
28 changes: 17 additions & 11 deletions packages/forms/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/observable/fromPromise': 'Rx.Observable',
'rxjs/observable/forkJoin': 'Rx.Observable',
'rxjs/operator/map': 'Rx.Observable.prototype'
};

export default {
entry: '../../dist/packages-dist/forms/@angular/forms.es5.js',
dest: '../../dist/packages-dist/forms/bundles/forms.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.forms',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/observable/fromPromise': 'Rx.Observable',
'rxjs/observable/forkJoin': 'Rx.Observable',
'rxjs/operator/map': 'Rx.Observable.prototype'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
20 changes: 13 additions & 7 deletions packages/http/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
};

export default {
entry: '../../dist/packages-dist/http/@angular/http.es5.js',
dest: '../../dist/packages-dist/http/bundles/http.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.http',
globals: {
'@angular/core': 'ng.core',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};
26 changes: 16 additions & 10 deletions packages/http/testing/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@
* found in the LICENSE file at https://angular.io/license
*/

import resolve from 'rollup-plugin-node-resolve';

const globals = {
'@angular/core': 'ng.core',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/http': 'ng.http',
'rxjs/Observable': 'Rx',
'rxjs/ReplaySubject': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/operator/take': 'Rx.Observable.prototype'
};

export default {
entry: '../../../dist/packages-dist/http/@angular/http/testing.es5.js',
dest: '../../../dist/packages-dist/http/bundles/http-testing.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.http.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/http': 'ng.http',
'rxjs/Observable': 'Rx',
'rxjs/ReplaySubject': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/operator/take': 'Rx.Observable.prototype'
}
plugins: [resolve()],
external: Object.keys(globals),
globals: globals
};

0 comments on commit 8ce481a

Please sign in to comment.