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:
Tim Lancina
2015-12-16 16:17:27 -06:00
parent bc2ec0ce16
commit 24b4088bfb
2 changed files with 30 additions and 2 deletions

View File

@ -25,8 +25,7 @@ var tscOptions = {
experimentalDecorators: true,
target: "es5",
module: "commonjs",
declaration: true,
outDir: "dist"
declaration: true
}
var tscOptionsNoTypeCheck = {
@ -37,6 +36,13 @@ var tscOptionsNoTypeCheck = {
isolatedModules: true
}
var tscOptionsEs6 = {
emitDecoratorMetadata: true,
experimentalDecorators: true,
target: 'ES6',
isolatedModules: true
}
var tscReporter = {
error: function (error) {
// 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) {
runSequence(
'copy.web-animations',
@ -149,6 +166,16 @@ gulp.task('transpile.typecheck', function(){
.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('bundle', ['transpile'], function(done){

View File

@ -43,6 +43,7 @@
"glob": "^5.0.14",
"gulp": "~3.8.10",
"gulp-autoprefixer": "^2.3.0",
"gulp-babel": "^5.3.0",
"gulp-cached": "^1.1.0",
"gulp-concat": "~2.5.0",
"gulp-connect": "^2.2.0",