javascript - Call task by default in gulp with flag -
someone can me? have next gulpfile...
var gulp = require('gulp') sass = require('gulp-sass'), cleancss = require('gulp-clean-css'), sourcemaps = require('gulp-sourcemaps'), rename = require('gulp-rename'), gulpngconfig = require('gulp-ng-config'), browsersync = require('browser-sync').create(), gutil = require('gulp-util'), environmentconfig = require('./enviroment.json'); //enviroment configuration gulp.task('setenviroment', function () { gulp.src('enviroment.json') .pipe(gulpngconfig('originacion.constants', { environment: 'env.development' })) .pipe(rename('constants.js')) .pipe(gulp.dest('js',{ overwrite:true })) }); gulp.task('browser-sync', function() { browsersync.init({ server: environmentconfig.path_app, port: gutil.env.mod == 'development' ? environmentconfig.env.development.port : environmentconfig.env.production.port }); }); if need call browser-sync task, use:
gulp browser-sync --mod production i want call 2 tasks in gulp task, this:
gulp.task('init', ['setenviroment', 'browser-sync']); my ask is: can call task default flag?... example
gulp.task('init', ['setenviroment', 'browser-sync:development']); for call browser-sync flag --mod production default
Comments
Post a Comment