-
addEntry
-
addModule
-
buildModule
buildModule(module, callback) {
this.buildQueue.add(module, callback);
}
this.buildQueue = new AsyncQueue({
name: "build",
parent: this.factorizeQueue,
processor: this._buildModule.bind(this)
});
-
_buildModule
-
调用子module的build方法
- 如果是JS文件,则调用webpack/lib/NormalModule.js中的build方法
- 如果是css文件,且配置了css-minimizer-webpack-plugin插件作为编译器,则调用该插件的build方法。
css-minimizer-webpack-plugin插件的build方法
build(options, compilation, resolver, fileSystem, callback) {
this.buildInfo = {
assets: this.assets,
assetsInfo: this.assetsInfo,
cacheable: true,
hash: this._computeHash(compilation.outputOptions.hashFunction)
};
this.buildMeta = {};
this._needBuild = false;
callback();
}
- build方法中会计算文件hash