.

gulp parameters

function gulpConfig(environment) {
    return gulp.src('config/app.json')
        .pipe(gulpNgConfig('app.config', {
            environment: environment
        }))
        .pipe(rename("app.config.js"))
        .pipe(gulp.dest('src/app/'));
}

/**
 * creates config files
 * @return {Stream}
 */
gulp.task('config-dev', function () {
    var option, i = process.argv.indexOf("--env");
    if (i > -1) {
        option = process.argv[i + 1];
    }
    log('Configuring app: ' + option);

    return gulpConfig(option);
});

gulp.task('config-test', function () {
    return gulpConfig('test');
});

What's your thoughts on this?

*

Protected by WP Anti Spam