Skip to content

Commit 687e2d0

Browse files
author
Pavithra K
committed
Small fixes to the info
1 parent eff064d commit 687e2d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/pluginsapi/compiler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It is exported by `webpack` api under `webpack.Compiler`.
99

1010
The compiler is used by webpack by instantiating it and then calling the `run` method. Below is a trivial example of how one might use the `Compiler`. In fact, this is very close to how webpack itself uses it.
1111

12-
[__compiler-examples__](https://github.com/pksjce/webpack-internal-examples/blob/master/compiler-example.js)
12+
[__compiler-example__](https://github.com/pksjce/webpack-internal-examples/blob/master/compiler-example.js)
1313

1414
```javascript
1515
// Can be imported from webpack package
@@ -49,10 +49,10 @@ compiler.run(callback);
4949
The `Compiler` is what we call a `Tapable` instance. By this, we mean that it mixes in `Tapable` class to imbibe functionality to register and call plugins on itself.
5050
All user facing plugins are first registered on the `Compiler`.
5151
The working of a Compiler can be condensed into the following highlights
52-
- Usually there is one master instance of Compiler. Child instances for delegating are possible.
52+
- Usually there is one master instance of Compiler. Child compilers can be created for delegating specific tasks.
5353
- A lot of the complexity in creating a compiler goes into populating all the relevant options for it.
5454
- `webpack` has [`WebpackOptionsDefaulter`](https://github.com/webpack/webpack/blob/master/lib/WebpackOptionsDefaulter.js) and [`WebpackOptionsApply`](https://github.com/webpack/webpack/blob/master/lib/WebpackOptionsApply.js) specifically designed to provide the `Compiler` with all the intial data it requires.
55-
- The `Compiler` is just a skeleton which performs bare minimum functionality to keep a lifecycle running. It delegates all the loading/bundling/writing work to various plugins.
55+
- The `Compiler` is just ultimately just a function which performs bare minimum functionality to keep a lifecycle running. It delegates all the loading/bundling/writing work to various plugins.
5656
- `new LogPlugin(args).apply(compiler)` registers the plugin to any particular hook event in the `Compiler`'s lifecycle.
5757
- The `Compiler` exposes a `run` method which kickstarts all compilation work for `webpack`. When that is done, it should call the passed in `callback` function. All the tail end work of logging stats and errors are done in this callback function.
5858

0 commit comments

Comments
 (0)