-
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): split up code and source polyfill task (#8130)
* feat(polyfills): split up code and source polyfill task * fix(polyfills): get rid of need for entries argument
- Loading branch information
1 parent
11f4f51
commit bcec66c
Showing
7 changed files
with
100 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,3 @@ export const NPM_VENDOR_FILES = [ | |
|
||
// SERVER | ||
export const LOCAL_SERVER_PORT = 8080; | ||
|
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,7 @@ | ||
import { task } from 'gulp'; | ||
import { writePolyfills } from '../util'; | ||
|
||
|
||
task('src.polyfill', () => { | ||
writePolyfills('scripts/polyfill'); | ||
}); |
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 |
---|---|---|
@@ -1,100 +1,13 @@ | ||
import { task, src, dest } from 'gulp'; | ||
const rollup = require('rollup'); | ||
const nodeResolve = require('rollup-plugin-node-resolve'); | ||
const commonjs = require('rollup-plugin-commonjs'); | ||
const multiEntry = require('rollup-plugin-multi-entry'); | ||
const uglify = require('rollup-plugin-uglify'); | ||
import { writePolyfills } from '../util'; | ||
|
||
const nodeResolveOptions = { | ||
jsnext: true, | ||
main: true | ||
}; | ||
task('polyfill', ['polyfill.copy-readme', 'polyfill.write']); | ||
|
||
const modernEntries = [ | ||
'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', | ||
'node_modules/core-js/es6/reflect.js', | ||
'node_modules/zone.js/dist/zone.js', | ||
]; | ||
|
||
const allEntries = [ | ||
'node_modules/core-js/es6/index.js', | ||
'node_modules/core-js/es7/reflect.js', | ||
'node_modules/zone.js/dist/zone.js', | ||
]; | ||
|
||
const ngEntries = [ | ||
'node_modules/core-js/es7/reflect.js', | ||
'node_modules/zone.js/dist/zone.js', | ||
]; | ||
|
||
task('polyfill', ['polyfill.modern', 'polyfill.all', 'polyfill.ng', 'polyfill.copy-readme']); | ||
|
||
task('polyfill.all', () => { | ||
return rollup.rollup({ | ||
entry: allEntries, | ||
plugins: [ | ||
multiEntry(), | ||
nodeResolve(nodeResolveOptions), | ||
commonjs(), | ||
uglify() | ||
] | ||
}).then((bundle) => { | ||
bundle.write({ | ||
format: 'iife', | ||
moduleName: 'MyBundle', | ||
dest: 'dist/ionic-angular/polyfills/polyfills.js' | ||
}); | ||
}); | ||
}); | ||
|
||
task('polyfill.ng', () => { | ||
return rollup.rollup({ | ||
entry: ngEntries, | ||
plugins: [ | ||
multiEntry(), | ||
nodeResolve(nodeResolveOptions), | ||
commonjs(), | ||
uglify() | ||
] | ||
}).then((bundle) => { | ||
bundle.write({ | ||
format: 'iife', | ||
moduleName: 'MyBundle', | ||
dest: 'dist/ionic-angular/polyfills/polyfills.ng.js' | ||
}); | ||
}); | ||
}); | ||
|
||
task('polyfill.modern', (done) => { | ||
return rollup.rollup({ | ||
entry: modernEntries, | ||
plugins: [ | ||
multiEntry(), | ||
nodeResolve(nodeResolveOptions), | ||
commonjs(), | ||
uglify() | ||
] | ||
}).then((bundle) => { | ||
bundle.write({ | ||
format: 'iife', | ||
moduleName: 'MyBundle', | ||
dest: 'dist/ionic-angular/polyfills/polyfills.modern.js' | ||
}); | ||
}); | ||
task('polyfill.write', () => { | ||
writePolyfills('dist/ionic-angular/polyfills'); | ||
}); | ||
|
||
task('polyfill.copy-readme', (done) => { | ||
task('polyfill.copy-readme', (done: Function) => { | ||
return src('scripts/polyfill/readme.md') | ||
.pipe(dest('dist/ionic-angular/polyfills/'), 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
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