Result#files #744

Open
ai opened this Issue Feb 22, 2016 · 2 comments

Projects

None yet

3 participants

@ai
Member
ai commented Feb 22, 2016

We have few very useful plugins, which create another files whild execution:

Right now most of this plugins accepts callback and send new file to this callback.

Maybe we should add Result#files array. And plugins will be able to push addition file content to this array. PostCSS runner like gulp-postcss will look into this array and add all this files to output stream.

Benefits:

  1. We will be able to generate correct sources maps for additional CSS.
  2. Plugin configuartion will be easy.

Problems:

  1. If user have some CSS tool after gulp-postcss, he/she will be forces to use filter to ignore JSON files from postcss-modules from next CSS tools.
  2. What we will do with postcss-webpack? It is a main problem. But we can keep this callback and just warn user to use callback.

We can add this feature to 5.1 version.

/cc @outpunk @ctxhou @w0rm @jonathantneal @Termina1 @Ser-Gen

@ai ai added the enhancement label Feb 22, 2016
@Ser-Gen
Contributor
Ser-Gen commented Feb 22, 2016

Well, I think I mess up with dest option :
All the files generated by my plugin alone is really only the result of the source transformation.
Standardized options in Postcss API and our plugins will be much better.

Maybe it can simplify processing of generated files?

@ben-eb
Member
ben-eb commented Sep 15, 2016

It might be nice to use https://github.com/wooorm/vfile for this. 😄

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