Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
compile both browser and node with downlevelIteration option
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion committed Sep 12, 2017
1 parent 1b36fc8 commit e23018a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 63 deletions.
14 changes: 3 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,16 @@ gulp.task('compile', function(cb) {
tsc('tsconfig.json', cb);
});

gulp.task('compile-node', function(cb) {
tsc('tsconfig-node.json', cb);
});

gulp.task('compile-esm', function(cb) {
tsc('tsconfig-esm.json', cb);
});

gulp.task('compile-esm-node', function(cb) {
tsc('tsconfig-esm-node.json', cb);
});

gulp.task('build/zone.js.d.ts', ['compile-esm'], function() {
return gulp.src('./build-esm/lib/zone.d.ts').pipe(rename('zone.js.d.ts')).pipe(gulp.dest('./dist'));
});

// Zone for Node.js environment.
gulp.task('build/zone-node.js', ['compile-esm-node'], function(cb) {
gulp.task('build/zone-node.js', ['compile-esm'], function(cb) {
return generateScript('./lib/node/rollup-main.ts', 'zone-node.js', false, cb);
});

Expand All @@ -105,7 +97,7 @@ gulp.task('build/zone.js', ['compile-esm'], function(cb) {
});

// Zone for electron/nw environment.
gulp.task('build/zone-mix.js', ['compile-esm-node'], function(cb) {
gulp.task('build/zone-mix.js', ['compile-esm'], function(cb) {
return generateScript('./lib/mix/rollup-mix.ts', 'zone-mix.js', false, cb);
});

Expand Down Expand Up @@ -272,7 +264,7 @@ gulp.task('build', [
'build/closure.js'
]);

gulp.task('test/node', ['compile-node'], function(cb) {
gulp.task('test/node', ['compile'], function(cb) {
var JasmineRunner = require('jasmine');
var jrunner = new JasmineRunner();

Expand Down
3 changes: 2 additions & 1 deletion test/common/Promise.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ describe(

it('should resolve generators', ifEnvSupports(
() => {
return isNode;
return navigator &&
navigator.userAgent.indexOf('PhantomJS') === -1;
},
() => {
const generators: any = function*() {
Expand Down
26 changes: 0 additions & 26 deletions tsconfig-esm-node.json

This file was deleted.

1 change: 1 addition & 0 deletions tsconfig-esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"noEmitOnError": false,
"stripInternal": true,
"sourceMap": true,
"downlevelIteration": true,
"moduleResolution": "node",
"lib": ["es5", "dom", "es2015.promise"]
},
Expand Down
24 changes: 0 additions & 24 deletions tsconfig-node.json

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"declaration": false,
"noEmitOnError": false,
"stripInternal": false,
"downlevelIteration": true,
"lib": ["es5", "dom", "es2015.promise"]
},
"exclude": [
Expand All @@ -20,4 +21,4 @@
"dist",
"lib/closure"
]
}
}

0 comments on commit e23018a

Please sign in to comment.