mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
giggity
This commit is contained in:
42
gulpfile.js
42
gulpfile.js
@ -27,9 +27,10 @@ var cache = require('gulp-cached');
|
|||||||
gulp.task('clean.build', function() {
|
gulp.task('clean.build', function() {
|
||||||
runSequence(
|
runSequence(
|
||||||
'clean',
|
'clean',
|
||||||
'ionic.transpile',
|
'transpile',
|
||||||
'ionic.bundle.deps',
|
'bundle.deps',
|
||||||
'ionic.examples',
|
'bundle.js',
|
||||||
|
'examples',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'polyfills');
|
'polyfills');
|
||||||
@ -37,8 +38,9 @@ gulp.task('clean.build', function() {
|
|||||||
|
|
||||||
gulp.task('build', function() {
|
gulp.task('build', function() {
|
||||||
runSequence(
|
runSequence(
|
||||||
'ionic.transpile',
|
'transpile',
|
||||||
'ionic.examples',
|
'bundle.js',
|
||||||
|
'examples',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'polyfills');
|
'polyfills');
|
||||||
@ -47,23 +49,30 @@ gulp.task('build', function() {
|
|||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
|
|
||||||
runSequence(
|
runSequence(
|
||||||
'ionic.transpile',
|
'transpile',
|
||||||
'ionic.examples',
|
'bundle.js',
|
||||||
|
'examples',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'polyfills',
|
'polyfills',
|
||||||
|
|
||||||
function() {
|
function() {
|
||||||
watch(['ionic/**/*.js', 'ionic/components/*/test/**/*'], function() {
|
watch(['ionic/**/*.js', '!ionic/components/*/test/**/*'], function() {
|
||||||
gulp.start('ionic.transpile');
|
runSequence(
|
||||||
gulp.start('ionic.examples');
|
'transpile',
|
||||||
|
'bundle.js',
|
||||||
|
'examples'
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
watch('ionic/components/*/test/**/*', function() {
|
||||||
|
gulp.start('examples');
|
||||||
});
|
});
|
||||||
|
|
||||||
watch('ionic/components/**/*.scss', function() {
|
watch('ionic/components/**/*.scss', function() {
|
||||||
gulp.start('sass');
|
gulp.start('sass');
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function doubleCheckDistFiles() {
|
function doubleCheckDistFiles() {
|
||||||
@ -100,18 +109,22 @@ var babelOptions = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('ionic.transpile', function(done) {
|
gulp.task('transpile', function() {
|
||||||
return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
||||||
.pipe(cache('transpile', { optimizeMemory: true }))
|
.pipe(cache('transpile', { optimizeMemory: true }))
|
||||||
.pipe(traceur(traceurOptions))
|
.pipe(traceur(traceurOptions))
|
||||||
.pipe(gulp.dest('dist/js/es6/ionic'))
|
.pipe(gulp.dest('dist/js/es6/ionic'))
|
||||||
.pipe(babel(babelOptions))
|
.pipe(babel(babelOptions))
|
||||||
.pipe(gulp.dest('dist/js/es5/ionic'))
|
.pipe(gulp.dest('dist/js/es5/ionic'))
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('bundle.js', function() {
|
||||||
|
return gulp.src('dist/js/es5/ionic/**/*.js')
|
||||||
.pipe(concat('ionic.bundle.js'))
|
.pipe(concat('ionic.bundle.js'))
|
||||||
.pipe(gulp.dest('dist/js/'));
|
.pipe(gulp.dest('dist/js/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('ionic.bundle.deps', function() {
|
gulp.task('bundle.deps', function() {
|
||||||
var Builder = require('systemjs-builder')
|
var Builder = require('systemjs-builder')
|
||||||
var builder = new Builder();
|
var builder = new Builder();
|
||||||
return builder.loadConfig('config.js').then(function(){
|
return builder.loadConfig('config.js').then(function(){
|
||||||
@ -126,11 +139,12 @@ gulp.task('ionic.bundle.deps', function() {
|
|||||||
});
|
});
|
||||||
return builder.build('dist/js/es6/ionic/**/* - [dist/js/es6/ionic/**/*]', 'dist/js/dependencies.js');
|
return builder.build('dist/js/es6/ionic/**/* - [dist/js/es6/ionic/**/*]', 'dist/js/dependencies.js');
|
||||||
}, function(error){
|
}, function(error){
|
||||||
|
console.log("Error building dependency bundle, have you transpiled Ionic and/or built Angular2 yet?");
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('ionic.examples', function() {
|
gulp.task('examples', function() {
|
||||||
var buildTest = lazypipe()
|
var buildTest = lazypipe()
|
||||||
.pipe(traceur, traceurOptions)
|
.pipe(traceur, traceurOptions)
|
||||||
//.pipe(babel, babelOptions) Let SystemJS load index.js at runtime, saves build time
|
//.pipe(babel, babelOptions) Let SystemJS load index.js at runtime, saves build time
|
||||||
|
@ -40,7 +40,7 @@ export class Aside {
|
|||||||
this.domElement.setAttribute('side', this.side);
|
this.domElement.setAttribute('side', this.side);
|
||||||
this.domElement.setAttribute('type', this.type);
|
this.domElement.setAttribute('type', this.type);
|
||||||
|
|
||||||
console.log('Aisde content', this.content);
|
console.log('Aside content', this.content);
|
||||||
|
|
||||||
this.config = Aside.config.invoke(this)
|
this.config = Aside.config.invoke(this)
|
||||||
this.gestureDelegate = this.config.getDelegate('gesture');
|
this.gestureDelegate = this.config.getDelegate('gesture');
|
||||||
|
Reference in New Issue
Block a user