-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(): polyfills task * fix(): remove base option * fix(): minification and small polyfills * fix(): add readme and new file names * fix(): change task names * fix(): naming changes
- Loading branch information
1 parent
f477aa2
commit ce78194
Showing
4 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { task, src, dest } from 'gulp'; | ||
const concat = require('gulp-concat'); | ||
const uglify = require('gulp-uglify'); | ||
|
||
task('polyfill', ['polyfill.modern', 'polyfill.all', 'polyfill.ng', 'polyfill.copy-readme']); | ||
|
||
task('polyfill.modern', (done) => { | ||
return src([ | ||
'node_modules/zone.js/dist/zone.min.js', | ||
'node_modules/zone.js/dist/proxy.min.js', | ||
'node_modules/core-js/es6/array.js', | ||
'node_modules/core-js/es6/date.js', | ||
'node_modules/core-js/es6/function.js', | ||
'node_modules/core-js/es6/map.js', | ||
'node_modules/core-js/es6/number.js', | ||
'node_modules/core-js/es6/object.js', | ||
'node_modules/core-js/es6/parse-float.js', | ||
'node_modules/core-js/es6/parse-int.js', | ||
'node_modules/core-js/es6/promise.js', | ||
'node_modules/core-js/es6/set.js', | ||
'node_modules/core-js/es6/string.js', | ||
'node_modules/core-js/es7/reflect.js' | ||
]) | ||
.pipe(concat('polyfills.modern.js')) | ||
.pipe(uglify()) | ||
.pipe(dest('dist/ionic-angular/polyfills/'), done); | ||
}); | ||
|
||
task('polyfill.all', (done) => { | ||
return src([ | ||
'node_modules/zone.js/dist/zone.min.js', | ||
'node_modules/zone.js/dist/proxy.min.js', | ||
'node_modules/core-js/es6/index.js', | ||
'node_modules/core-js/es7/reflect.js' | ||
]) | ||
.pipe(concat('polyfills.js')) | ||
.pipe(uglify()) | ||
.pipe(dest('dist/ionic-angular/polyfills/'), done); | ||
}); | ||
|
||
task('polyfill.ng', (done) => { | ||
return src([ | ||
'node_modules/zone.js/dist/zone.min.js', | ||
'node_modules/zone.js/dist/proxy.min.js', | ||
'node_modules/core-js/es7/reflect.js' | ||
]) | ||
.pipe(concat('polyfills.ng.js')) | ||
.pipe(uglify()) | ||
.pipe(dest('dist/ionic-angular/polyfills/'), done); | ||
}); | ||
|
||
task('polyfill.copy-readme', (done) => { | ||
return src('scripts/npm/polyfills.readme.md') | ||
.pipe(dest('dist/ionic-angular/polyfills/README.md'), done); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## polyfills.js | ||
Contains all polyfills needed to work on the largest range of devices. This is the default polyfill. | ||
|
||
##### Targets: | ||
- Android 4.4.2 and above | ||
- iOS back to iOS 8 | ||
|
||
##### Includes: | ||
- All ES6 features | ||
- zone.js | ||
- ES7 reflection | ||
|
||
|
||
## polyfills.modern.js | ||
A limited of set of polyfills to work on more modern browsers. This file limits the number of ES6 polyfills which are already natively included in modern browsers. | ||
|
||
##### Targets: | ||
- Android 5.0 and above | ||
- iOS 9 and above | ||
|
||
##### Includes: | ||
- zone.js | ||
- ES7 reflection, | ||
- ES6 polyfills, except for: | ||
new regexp features, | ||
math features, | ||
symbols, | ||
typed arrays, | ||
weak maps / weak sets | ||
|
||
|
||
## polyfills.ng.js | ||
Only the required polyfill for Angular 2. This does not come with any ES6 polyfills. Note that all polyfill files listed here included the required polyfills for Angular 2 to work correctly. | ||
|
||
##### Targets: | ||
- Android 5.0 and above | ||
- iOS 10 and above | ||
|
||
##### Includes: | ||
- zone.js | ||
- ES7 reflection | ||
|
||
|
||
## ECMAScript 6 Compatibility | ||
|
||
To easily judge which polyfill you may need you can check this [ES6 support table](https://kangax.github.io/compat-table/es6/). |