MCPcopy
hub / github.com/webpack/webpack / apply

Method apply

lib/WatchIgnorePlugin.js:138–158  ·  view source on GitHub ↗

* Applies the plugin by registering its hooks on the compiler. * @param {Compiler} compiler the compiler instance * @returns {void}

(compiler)

Source from the content-addressed store, hash-verified

136 * @returns {void}
137 */
138 apply(compiler) {
139 compiler.hooks.validate.tap(PLUGIN_NAME, () => {
140 compiler.validate(
141 () => require("../schemas/plugins/WatchIgnorePlugin.json"),
142 this.options,
143 {
144 name: "Watch Ignore Plugin",
145 baseDataPath: "options"
146 },
147 (options) =>
148 require("../schemas/plugins/WatchIgnorePlugin.check")(options)
149 );
150 });
151 compiler.hooks.afterEnvironment.tap(PLUGIN_NAME, () => {
152 compiler.watchFileSystem = new IgnoringWatchFileSystem(
153 /** @type {WatchFileSystem} */
154 (compiler.watchFileSystem),
155 this.options.paths
156 );
157 });
158 }
159}
160
161module.exports = WatchIgnorePlugin;

Callers

nothing calls this directly

Calls 3

tapMethod · 0.80
validateMethod · 0.80
requireFunction · 0.50

Tested by

no test coverage detected