* Applies the plugin by registering its hooks on the compiler. * @param {Compiler} compiler the compiler instance * @returns {void}
(compiler)
| 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 | |
| 161 | module.exports = WatchIgnorePlugin; |