Пример #1
0
Fontmin.prototype.getFiles = function () {
    if (Buffer.isBuffer(this.src())) {
        return bufferToVinyl.stream(this.src());
    }

    return vfs.src(this.src());
};
Пример #2
0
Decompress.prototype.getFiles = function () {
	if (Buffer.isBuffer(this.src())) {
		return bufferToVinyl.stream(this.src());
	}

	return vinylFs.src(this.src());
};
Пример #3
0
pipes.builtConfig = function () {
    var json = JSON.stringify(configGenerator().client);
    return b2v.stream(new Buffer(json))
        .pipe(ngConfig("DCX", {
            wrap: "(function () {\n\"use strict\";\nreturn <%= module %>\n})();",
            createModule: false
        }))
        .pipe(rename("env.config.js"));
};
Пример #4
0
gulp.task('config', task.config = function() {
    var json = JSON.stringify({
        env: {
            api:            process.env.API,
            api_key:        process.env.API_KEY,
            api_version:    process.env.API_VERSION,
            node_env:       process.env.NODE_ENV,
            node_port:      process.env.NODE_PORT
        }
    });

    return b2v.stream(new Buffer(json), 'environment.js')
        .pipe(gulpNgConfig('app.env', { pretty: true }))
        .pipe(gulp.dest(paths.dist + '/assets/js'));
});
Пример #5
0
gulp.task('make-config', function() {
    var json = JSON.stringify({
        "production": { 
            "ENV": { 
                "api": "https://gmail-clone.herokuapp.com/", 
                "development": false 
            } 
        }, 
        "development": { 
            "ENV": { 
                "api": "http://localhost:6660/", 
                "development": true 
            } 
        }
    });

  return b2v.stream(new Buffer(json), 'app.config.module.js')
    .pipe(gulpNgConfig('app.config', {
        environment: ENV,
        wrap: '(function() {\n\t\'use strict\';\n\n\t<%= module %>\n})();'
    }))
    .pipe(gulp.dest(paths.app));
});