mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
cache rules everything around me
This commit is contained in:
16
gulpfile.js
16
gulpfile.js
@ -21,6 +21,7 @@ var babel = require('gulp-babel');
|
|||||||
var traceur = require('gulp-traceur');
|
var traceur = require('gulp-traceur');
|
||||||
var webpack = require('gulp-webpack');
|
var webpack = require('gulp-webpack');
|
||||||
var lazypipe = require('lazypipe');
|
var lazypipe = require('lazypipe');
|
||||||
|
var cache = require('gulp-cached');
|
||||||
|
|
||||||
|
|
||||||
gulp.task('clean.build', function() {
|
gulp.task('clean.build', function() {
|
||||||
@ -46,22 +47,15 @@ gulp.task('build', function() {
|
|||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
|
|
||||||
runSequence(
|
runSequence(
|
||||||
'clean',
|
'ionic.transpile',
|
||||||
'ionic.traceur',
|
|
||||||
'ionic.bundle.deps',
|
|
||||||
'ionic.bundle.js',
|
|
||||||
'ionic.examples',
|
'ionic.examples',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
'polyfills',
|
'polyfills',
|
||||||
|
|
||||||
function() {
|
function() {
|
||||||
watch('ionic/**/*.js', function() {
|
watch(['ionic/**/*.js', 'ionic/components/*/test/**/*'], function() {
|
||||||
gulp.start('');
|
gulp.start('ionic.transpile');
|
||||||
});
|
|
||||||
|
|
||||||
watch('ionic/components/*/test/**/*', function() {
|
|
||||||
doubleCheckDistFiles();
|
|
||||||
gulp.start('ionic.examples');
|
gulp.start('ionic.examples');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -108,6 +102,7 @@ var babelOptions = {
|
|||||||
|
|
||||||
gulp.task('ionic.transpile', function(done) {
|
gulp.task('ionic.transpile', function(done) {
|
||||||
return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
||||||
|
.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))
|
||||||
@ -142,6 +137,7 @@ gulp.task('ionic.examples', function() {
|
|||||||
|
|
||||||
// Get each test folder with gulp.src
|
// Get each test folder with gulp.src
|
||||||
return gulp.src('ionic/components/*/test/*/**/*')
|
return gulp.src('ionic/components/*/test/*/**/*')
|
||||||
|
.pipe(cache('examples', { optimizeMemory: true }))
|
||||||
.pipe(gulpif(/.js$/, buildTest()))
|
.pipe(gulpif(/.js$/, buildTest()))
|
||||||
.pipe(gulpif(/index.js$/, createIndexHTML()))
|
.pipe(gulpif(/index.js$/, createIndexHTML()))
|
||||||
.pipe(rename(function(file) {
|
.pipe(rename(function(file) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"gulp": "~3.8.10",
|
"gulp": "~3.8.10",
|
||||||
"gulp-autoprefixer": "^2.3.0",
|
"gulp-autoprefixer": "^2.3.0",
|
||||||
"gulp-babel": "^5.1.0",
|
"gulp-babel": "^5.1.0",
|
||||||
"gulp-cached": "^1.0.4",
|
"gulp-cached": "^1.1.0",
|
||||||
"gulp-concat": "~2.5.0",
|
"gulp-concat": "~2.5.0",
|
||||||
"gulp-debug": "~2.0.1",
|
"gulp-debug": "~2.0.1",
|
||||||
"gulp-if": "^1.2.5",
|
"gulp-if": "^1.2.5",
|
||||||
|
Reference in New Issue
Block a user