Skip to content

Commit

Permalink
feat: 运行分析之运行时 - compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkasany committed Jan 22, 2024
1 parent 7a9acab commit 18fb094
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/webpack/4.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,3 +502,22 @@ hooks.f.callAsync(1, 2, (err, data) => {
```

<!-- -->

# 运行分析之运行时 - compiler

> compiler:每次webpack启动的唯一
>
> create compiler -> run -> create compilation -> make -> afterCompiler -> emit -> emitAssets
- compiler.options: webpack 启动时的所有配置
- compiler.inputFileSystem、compiler.outputFileSystem: 文件操作,类似nodejs中的fs
- compiler.hooks: 注册各种hook,应用在编译周期中

> compilation: 一次构建过程
>
> buildModule -> seal -> optimize -> reviveChunks -> seal
- modules: 所有模块
- chunks:多个module组成
- assets:打包生成的文件
- hooks:注册各种hook,作用在编译过程
1 change: 1 addition & 0 deletions docs/webpack/loader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loader
1 change: 1 addition & 0 deletions docs/webpack_summary.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- 🔧 webpack 笔记
- [基本配置](/docs/webpack/3.md)
- [打包原理](/docs/webpack/4.md)
- [loader](/docs/webpack/loader.md)

0 comments on commit 18fb094

Please sign in to comment.