diff --git a/gulpfile.js b/gulpfile.js
index 21fa7ff401..a67cd81fe3 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -23,6 +23,7 @@ var lazypipe = require('lazypipe');
var cache = require('gulp-cached');
var connect = require('gulp-connect');
var Dgeni = require('dgeni');
+var insert = require('gulp-insert');
function getBabelOptions(moduleName, moduleType) {
return {
@@ -50,18 +51,9 @@ var tscReporter = {
}
};
-gulp.task('clean.build', function(done) {
- runSequence(
- 'clean',
- 'build',
- done
- );
-})
-
gulp.task('build', function(done) {
runSequence(
- 'transpile',
- 'bundle.js',
+ 'bundle',
'e2e',
'sass',
'fonts',
@@ -69,25 +61,22 @@ gulp.task('build', function(done) {
);
})
-gulp.task('watch', function(done) {
+gulp.task('clean.build', function(done) {
+ runSequence('clean', 'build', done);
+})
+gulp.task('watch', function(done) {
runSequence(
- 'build',
'serve',
function() {
- watch(
- [
+ watch([
'ionic/**/*.js',
'ionic/**/*.ts',
'!ionic/components/*/test/**/*',
'!ionic/util/test/*'
],
function() {
- runSequence(
- 'transpile',
- 'bundle.js',
- 'e2e'
- )
+ runSequence('transpile', 'bundle.js', 'e2e');
}
);
@@ -104,6 +93,10 @@ gulp.task('watch', function(done) {
);
});
+gulp.task('build.watch', function(done){
+ runSequence('build', 'watch');
+})
+
gulp.task('serve', function() {
connect.server({
root: 'dist',
@@ -144,20 +137,39 @@ gulp.task('transpile.system', function() { return transpile("system"); });
gulp.task('transpile.common', function() { return transpile("common"); });
gulp.task('transpile', ['transpile.system']);
-gulp.task('bundle.js', function() {
- return gulp.src(['dist/js/es5/system/ionic/**/*.js', 'ionic/util/hairline.js'])
- .pipe(concat('ionic.bundle.js'))
- .pipe(gulp.dest('dist/js/'));
+gulp.task('bundle.ionic', ['transpile'], function() {
+ return gulp.src([
+ 'dist/js/es5/system/ionic/**/*.js',
+ 'ionic/util/hairline.js'
+ ])
+ .pipe(concat('ionic.js'))
+ .pipe(insert.append('System.config({ "paths": { "ionic/*": "ionic/*" } });'))
+ .pipe(gulp.dest('dist/js/'));
+ //TODO minify + sourcemaps
});
+gulp.task('bundle', ['bundle.ionic'], function() {
+ var nm = "node_modules";
+ return gulp.src([
+ 'node_modules/traceur/bin/traceur-runtime.js',
+ 'node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.js',
+ 'node_modules/systemjs/dist/system.js',
+ 'node_modules/angular2-build/angular2.dev.js',
+ 'dist/js/ionic.js',
+ 'node_modules/web-animations-js/web-animations.min.js'
+ ])
+ .pipe(concat('ionic.bundle.dev.js'))
+ .pipe(gulp.dest('dist/js'));;
+})
+
gulp.task('tests', function() {
return gulp.src('ionic/components/*/test/*/**/*.spec.ts')
- .pipe(tsc(tscOptions, null, tscReporter))
- .pipe(babel(getBabelOptions('tests')))
- .pipe(rename(function(file) {
- file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
- }))
- .pipe(gulp.dest('dist/tests'))
+ .pipe(tsc(tscOptions, null, tscReporter))
+ .pipe(babel(getBabelOptions('tests')))
+ .pipe(rename(function(file) {
+ file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
+ }))
+ .pipe(gulp.dest('dist/tests'))
})
gulp.task('copy-scripts', function(){
diff --git a/package.json b/package.json
index 149f20fc30..b5f47bebe6 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"gulp-connect": "^2.2.0",
"gulp-debug": "~2.0.1",
"gulp-if": "^1.2.5",
+ "gulp-insert": "^0.5.0",
"gulp-plumber": "^1.0.0",
"gulp-rename": "~1.2.0",
"gulp-sass": "^1.3.3",
@@ -44,5 +45,12 @@
"typescript": "^1.5.3",
"vinyl": "^0.4.6",
"yargs": "^3.6.0"
+ },
+ "dependencies": {
+ "angular2-build": "2.0.0-alpha.33",
+ "systemjs": "^0.16.11",
+ "traceur": "0.0.91",
+ "traceur-runtime": "0.0.59",
+ "web-animations-js": "tlancina/web-animations-js"
}
}
diff --git a/scripts/e2e/e2e.template.html b/scripts/e2e/e2e.template.html
index cb4079d055..427e9f8256 100644
--- a/scripts/e2e/e2e.template.html
+++ b/scripts/e2e/e2e.template.html
@@ -39,22 +39,21 @@
-
-
+
-
-
-
-
+ -->
+
+
+
+