フシギにステキな素早いヤバさ

フシギにステキな素早いヤバさを追いかけて。俺は行くだろう。

なぜassembleを直接使うべきでgulpは推奨されていないのか

ソース

https://github.com/assemble/assemble/#faq

I use gulp, why is it recommended to use assemble directly, instead of running assemble with gulp?

You can run gulp plugins with assemble, but it won't always work the other way around. This is because, as a build system, assemble does things that gulp doesn't do, like handle middleware.

For example, assemble's .src and .dest methods have built-in .onStream, .preWrite, and .postWrite middleware handlers. If you still wish to use gulp and your build cycle includes middleware that requires these handlers, you can use the assemble-handle plugin with gulp to ensure that the handlers are still called as needed.

This is a long way of saying, you can find ways to make gulp work, but you would just be adding an extra dependency to your project to do things that assemble already does.

gulpを使っているのですが、なぜgulpよりもassembleを直接使い、assembleをgulpの代わりに使わないことを推奨するのでしょうか。

assembleでgulpプラグインを使うことができます。しかしうまく動きません。その訳は、ビルドシステムとして、assembleはgulpがやらない仕事をやっているからです。例えばミドルウェアの処理です。

例を挙げると、assembleに .src と .dest というメソッドがありますが、これはミドルウェアの .onStream と .preWrite と .postWrite を処理するメソッドをビルトインしたものです。もし gulp を使いたいと考えており、使いたいシステムがそのような処理を必要とするミドルウェアを要求する場合、assemble-handle プラグインを gulp と一緒に使用することで、必要な時にそれらの処理が呼び出されるようにできます。

いうのには勇気が要るのですが、gulpをうまく動作させる方法を試すこともできるけれど、それよりは依存関係に必要なものを追加しながら assemble を使う方が、およそ便利だと思います。