gulpjs / vinyl

Virtual file format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating an Adapter

EisenbergEffect opened this issue · comments

I'm curious if a vinyl file adapter might be a good way to create a bundling system. So, in place of gulp.dest after transforming files, instead myBundle.dest(). Is this a legitimate use case? If so, can you point me to any resources that could be used in implementing the adapter? Thanks!

Yes, this is actually a better use for bundling tools than making them a gulp plugin. The .src method could traverse the dependency tree and the .dest could do unique things for the bundler. Someone is working on something similar for browserify at https://github.com/kt3k/vinyl-bundle

Great! I'm leading the Aurelia project. Our community primarily uses Gulp but we do have some Webpack users. I was looking into Webpack and it just struck me that it was odd how it had it's own plugin system, similar to Gulp, but not as nice. I then thought that it would be cool to leverage the full power of Gulp and its plugin ecosystem, but just add the final bundling piece on. At first I thought of that as a Gulp plugin...but that didn't seem quite right. As I was reading the docs, I discovered the adapter concept, which seems like a good fit. This could be a nice solution for our community to implement our own bundling with a natural way to plug into gulp. Thanks!