mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
add livereload to dev tasks
This commit is contained in:
13
gulpfile.js
13
gulpfile.js
@ -11,6 +11,7 @@ var babel = require('gulp-babel');
|
|||||||
var tsc = require('gulp-typescript');
|
var tsc = require('gulp-typescript');
|
||||||
var cache = require('gulp-cached');
|
var cache = require('gulp-cached');
|
||||||
var minimist = require('minimist');
|
var minimist = require('minimist');
|
||||||
|
var connect = require('gulp-connect');
|
||||||
|
|
||||||
var flagConfig = {
|
var flagConfig = {
|
||||||
string: ['port', 'version', 'ngVersion', 'animations'],
|
string: ['port', 'version', 'ngVersion', 'animations'],
|
||||||
@ -105,10 +106,9 @@ gulp.task('watch', function(done) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('serve', function() {
|
gulp.task('serve', function() {
|
||||||
var connect = require('gulp-connect');
|
|
||||||
connect.server({
|
connect.server({
|
||||||
port: flags.port,
|
port: flags.port,
|
||||||
livereload: false
|
livereload: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -158,9 +158,16 @@ gulp.task('bundle', ['transpile'], function(done){
|
|||||||
var config = require('./scripts/npm/ionic.webpack.config.js');
|
var config = require('./scripts/npm/ionic.webpack.config.js');
|
||||||
bundle({
|
bundle({
|
||||||
config: config,
|
config: config,
|
||||||
cb: done,
|
cb: finished,
|
||||||
stats: true
|
stats: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function finished(){
|
||||||
|
var outputPath = config.output.path + path.sep + config.output.filename;
|
||||||
|
gulp.src(outputPath)
|
||||||
|
.pipe(connect.reload())
|
||||||
|
.on('end', done)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function bundle(args) {
|
function bundle(args) {
|
||||||
|
Reference in New Issue
Block a user