Webpack中Pitching Loader的详细解析是怎样的?
- 内容介绍
- 文章标签
- 相关推荐
本文共计528个文字,预计阅读时间需要3分钟。
关于webpack中Pitching loader的文档描述,简化如下:
Pitching loader在webpack中从右向左调用。但在某些情况下,loader只关注元数据,而不关心前一个loader的结果或资源。
webpack中关于pitching loader的文档比较不清楚:
The loaders are called from right to left. But in some cases loaders do not care about the results of the previous loader or the resource. They only care for metadata. The pitch method on the loaders is called from left to right before the loaders are called. If a loader delivers a result in the pitch method the process turns around and skips the remaining loaders, continuing with the calls to the more left loaders. data can be passed between pitch and normal call.
比如a!b!c!module, 正常调用顺序应该是c、b、a,但是真正调用顺序是
a(pitch)、b(pitch)、c(pitch)、c、b、a, 如果其中任何一个pitching loader返回了值就相当于在它以及它右边的loader已经执行完毕。
本文共计528个文字,预计阅读时间需要3分钟。
关于webpack中Pitching loader的文档描述,简化如下:
Pitching loader在webpack中从右向左调用。但在某些情况下,loader只关注元数据,而不关心前一个loader的结果或资源。
webpack中关于pitching loader的文档比较不清楚:
The loaders are called from right to left. But in some cases loaders do not care about the results of the previous loader or the resource. They only care for metadata. The pitch method on the loaders is called from left to right before the loaders are called. If a loader delivers a result in the pitch method the process turns around and skips the remaining loaders, continuing with the calls to the more left loaders. data can be passed between pitch and normal call.
比如a!b!c!module, 正常调用顺序应该是c、b、a,但是真正调用顺序是
a(pitch)、b(pitch)、c(pitch)、c、b、a, 如果其中任何一个pitching loader返回了值就相当于在它以及它右边的loader已经执行完毕。

