Skip to content

Conversation

JimmyHurrah
Copy link

In bless you have the option to specify the output file name which enables you to write to the same directory as your original file without overwriting it.

I added a destinationFilename property to the options object to enable this.

@adam-lynch
Copy link
Member

Thanks a lot but notice this in the readme:

Warning: gulp-bless has changed a lot since 1.0.0

  • It no longer concatenates all files that come down the pipeline.
  • fileName can no longer be passed directly to the plugin itself.

It suits the Gulp way of things a lot more not to take a fileName parameter.


enables you to write to the same directory as your original file

To put something back in the directory it came from, you could do this:

gulp.src('./a/b/c/*.css', {base: './a/b/c'})
    .pipe(bless())
    .pipe(gulp.dest('./'))

Or of course (if all the files come from the one directory):

gulp.src('./a/b/c/*.css')
    .pipe(bless())
    .pipe(gulp.dest('./a/b/c'))

enables you to write to the same directory as your original file without overwriting it.

But this plugin doesn't output the same filename as the original so it wouldn't be overriden? It appends -blessed, right?


gulp-rename is really powerful too. You can rename the entire filename, add a prefix, suffix, etc.

@adam-lynch adam-lynch closed this Aug 20, 2014
@JimmyHurrah
Copy link
Author

Oh, sorry about that.

But this plugin doesn't output the same filename as the original so it wouldn't be overriden? It appends -blessed, right?

It only appended on the extracted files not the one holding the includes using the code below:

  gulp.src('Public/Css/main.css')
    .pipe(bless({ imports: true, }))
    .pipe(gulp.dest('Public/Css/');

I ended up using gulp-rename which, as you point out, feels more gulp.

@adam-lynch
Copy link
Member

Ah ok, good to know. bless.js appends the suffix, so I can't really control it.

That's good 😄. The great thing about Gulp plugins is they're meant to do one thing and do it well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants