Closed adamski closed 9 years ago
@adamski the best way to go about this would be to pipe it into gulp-rename.
@psalaets just added an Additional Usages section to the readme, i think this is a good candidate to also add since I believe this has been asked before. I'll keep this open as a reminder to add this example to the section
Example:
var gulp = require('gulp'),
ngConfig = require('gulp-ng-config'),
rename = require('gulp-rename');
gulp.task('build', function () {
return gulp.src('config.json')
.pipe(ngConfig('myApp.config'))
.pipe(rename('index.js'))
.pipe(gulp.dest('./src'));
});
I don't want to call the json file index.json
Just realized you said the output file was index.json
-- it should by default change the extension to .js
. Was this not the case for you?
Thanks for the tip about rename, was using shell mv for this.
To clarify it is changing the extension to .js
as it should be. Its just the filename I wanted to change.
Cool. I'd definitely choose to suggest the "gulp way" of doing things and drop rename
into the piping. Gulp promotes good separation of concerns by delegating a single responsibility to each member of the pipeline, and rename
would follow well here!
Cheers
I believe this is resolved, closing
I wish to change the generated file name, e.g. to index.js, is this possible? I don't want to call the json file index.json