mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(bundle): bring back system bundle
UMD bundle is great, but mainly meant for ES5/ngUpgrade apps, while the system bundle is for plunkers and in our case, tests.
This commit is contained in:
31
gulpfile.js
31
gulpfile.js
@ -25,8 +25,7 @@ var tscOptions = {
|
|||||||
experimentalDecorators: true,
|
experimentalDecorators: true,
|
||||||
target: "es5",
|
target: "es5",
|
||||||
module: "commonjs",
|
module: "commonjs",
|
||||||
declaration: true,
|
declaration: true
|
||||||
outDir: "dist"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var tscOptionsNoTypeCheck = {
|
var tscOptionsNoTypeCheck = {
|
||||||
@ -37,6 +36,13 @@ var tscOptionsNoTypeCheck = {
|
|||||||
isolatedModules: true
|
isolatedModules: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var tscOptionsEs6 = {
|
||||||
|
emitDecoratorMetadata: true,
|
||||||
|
experimentalDecorators: true,
|
||||||
|
target: 'ES6',
|
||||||
|
isolatedModules: true
|
||||||
|
}
|
||||||
|
|
||||||
var tscReporter = {
|
var tscReporter = {
|
||||||
error: function (error) {
|
error: function (error) {
|
||||||
// TODO
|
// TODO
|
||||||
@ -45,6 +51,17 @@ var tscReporter = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// We use Babel to easily create named System.register modules
|
||||||
|
// See: https://github.com/Microsoft/TypeScript/issues/4801
|
||||||
|
// and https://github.com/ivogabe/gulp-typescript/issues/211
|
||||||
|
var babelOptions = {
|
||||||
|
modules: 'system',
|
||||||
|
moduleIds: true,
|
||||||
|
getModuleId: function(name) {
|
||||||
|
return 'ionic/' + name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task('build', function(done) {
|
gulp.task('build', function(done) {
|
||||||
runSequence(
|
runSequence(
|
||||||
'copy.web-animations',
|
'copy.web-animations',
|
||||||
@ -149,6 +166,16 @@ gulp.task('transpile.typecheck', function(){
|
|||||||
.pipe(gulp.dest('dist'));
|
.pipe(gulp.dest('dist'));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
gulp.task('bundle.system', function(){
|
||||||
|
var babel = require('gulp-babel');
|
||||||
|
var concat = require('gulp-concat');
|
||||||
|
|
||||||
|
return tsCompile(tscOptionsEs6, 'babel')
|
||||||
|
.pipe(babel(babelOptions))
|
||||||
|
.pipe(concat('ionic.system.js'))
|
||||||
|
.pipe(gulp.dest('dist/bundles'))
|
||||||
|
})
|
||||||
|
|
||||||
gulp.task('transpile', ['transpile.no-typecheck']);
|
gulp.task('transpile', ['transpile.no-typecheck']);
|
||||||
|
|
||||||
gulp.task('bundle', ['transpile'], function(done){
|
gulp.task('bundle', ['transpile'], function(done){
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
"glob": "^5.0.14",
|
"glob": "^5.0.14",
|
||||||
"gulp": "~3.8.10",
|
"gulp": "~3.8.10",
|
||||||
"gulp-autoprefixer": "^2.3.0",
|
"gulp-autoprefixer": "^2.3.0",
|
||||||
|
"gulp-babel": "^5.3.0",
|
||||||
"gulp-cached": "^1.1.0",
|
"gulp-cached": "^1.1.0",
|
||||||
"gulp-concat": "~2.5.0",
|
"gulp-concat": "~2.5.0",
|
||||||
"gulp-connect": "^2.2.0",
|
"gulp-connect": "^2.2.0",
|
||||||
|
Reference in New Issue
Block a user