-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[webpack]源码解读:命令行输入webpack的时候都发生了什么? #12
Comments
webpack 2 实现上区别是啥? |
webpack 2 实现上区别是啥? |
emmmm 看完了 感觉能理解一个大概流程了~ 很棒! |
请问从webpackgithub下载下来的文件是怎么调试的啊?目录都是分别做什么啊? |
yyds |
已收到你的邮件,谢谢!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我们在使用 webpack 的时候可以通过
webpack
这个命令配合一些参数来执行我们打包编译的任务。我们想探究它的源码,从这个命令入手能够比较容易让我们了解整个代码的运行过程。那么在执行这个命令的时候究竟发生了什么呢?Step1:执行脚本
bin/webpack.js
step2:执行
lib/webpack.js
中的方法开始编译step3:调用
lib/WebpackOptionsApply.js
模块的process
方法来逐一编译 webpack 编译对象的各项step4:在 step3 中调用的各种插件会按照 webpack 编译对象的配置来构建出文件
总结
现在我们回过头来再看看整体流程,当我们在命令行输入 webpack 命令,按下回车时都发生了什么:
Compiler
,继承 Tapable 插件框架,实现注册和调用一系列插件。/WebpackOptionsApply.js
模块的process
方法,使用各种各样的插件来逐一编译 webpack 编译对象的各项。The text was updated successfully, but these errors were encountered: