webpack.js文件有一句代码特别拗口
compiler.apply.apply(compiler, options.plugins);
compiler = new Compiler(); compiler.context = options.context; compiler.options = options; new NodeEnvironmentPlugin().apply(compiler); if(options.plugins && Array.isArray(options.plugins)) { compiler.apply.apply(compiler, options.plugins); } compiler.applyPlugins("environment"); compiler.applyPlugins("after-environment"); compiler.options = new WebpackOptionsApply().process(options, compiler);
实际上是compiler有一个方法叫apply,通过Tapable继承而来,
此句代码是拿apply方法通过apply调用来更改上下文context(函数内部的this)
compiler.apply等于以下代码
Tapable.prototype.apply = function apply() { for(var i = 0; i < arguments.length; i++) { arguments[i].apply(this); } };
故而compiler.apply.apply(compiler, options.plugins)等于以下代码
for(var i = 0; i < options.plugins.length; i++) { options.plugins[i].apply.call(compiler); }
相关推荐
电脑需先安装Keil MDK5。此固件库为Keil官方提供,直接双击安装即可,安装成功后在MDK5工程的Device中验证,或者在PACK安装页面选择File->Import 官网下载比较慢,为方便大家提供分享
scala-compiler.jar
Version:1.6.0(2018-09-06) Release Notes: Added Cortex-M35P device support Event Recorder -extended SCVD file format with state information changed protocol version to 1.1 -added example projects for ...
jasper-compiler.jar
压缩js文件工具,并可提供.js.map映射文件,方便chrome断点调试,内含例子说明用法。互联网开发趁手之工具
jasper-compiler.jar jasper-runtime.jar 常用到的2个包
第七十六课:基于白名单Compiler.exe执行payload第六季.docx
compiler.xml
Intel.C.Plus.Plus.Compiler.v9.1.022-lic
Intel.C.Plus.Plus.Compiler.Professional.v11.1.060 的 licence 文件 ,经测试可用,另附安装说明。
spring的lib下的这个jar包有问题.这个是好的。
Engineering A Compiler.rar
Introduce types and prototypes of GTK+ for the compiler. Introduce types and prototypes of GTK+ for the compiler. Introduce types and prototypes of GTK+ for the compiler.
Building+an+Optimizing+Compiler.pdf 经典收藏; Building+an+Optimizing+Compiler.pdf 经典收藏; Building+an+Optimizing+Compiler.pdf 经典收藏; Building+an+Optimizing+Compiler.pdf 经典收藏
Interpretation, Type Checking, Intermediate-Code Generation, Machine-Code Generation, Register Allocation, Function calls, Analysis and optimisation, Memory management and Bootstrapping a compiler. ...
Intel.Visual.Fortran.Compiler.v10.1.014网上下载
jsCompressor 和 cssCompressor 选项指定控制台命令或PHP回调函数来执行 JavaScript 和 CSS 合并和压缩, Yii 默认使用 Closure Compiler 来合并 JavaScript 文件, 使用 YUI Compressor 来合并 CSS 文件
CCompiler.adt.zip
Intel.C.Plus.Plus.Compiler.v9.0.019-lic