* Applies the plugin by registering its hooks on the compiler. * @param {Compiler} compiler the compiler instance * @returns {void}
(compiler)
| 33 | * @returns {void} |
| 34 | */ |
| 35 | apply(compiler) { |
| 36 | compiler.hooks.compilation.tap( |
| 37 | PLUGIN_NAME, |
| 38 | (compilation, { normalModuleFactory }) => { |
| 39 | compilation.dependencyFactories.set( |
| 40 | EntryDependency, |
| 41 | normalModuleFactory |
| 42 | ); |
| 43 | } |
| 44 | ); |
| 45 | |
| 46 | const { entry, options, context } = this; |
| 47 | const dep = EntryPlugin.createDependency(entry, options); |
| 48 | |
| 49 | compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => { |
| 50 | compilation.addEntry(context, dep, options, (err) => { |
| 51 | callback(err); |
| 52 | }); |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Creates a dependency. |
nothing calls this directly
no test coverage detected