MCPcopy Create free account
hub / github.com/webpack/webpack-cli / CustomTestPlugin

Class CustomTestPlugin

test/watch/watch-variable/webpack.config.js:3–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1const isInProcess = process.env.WEBPACK_WATCH;
2
3class CustomTestPlugin {
4 constructor(isInEnvironment) {
5 this.isInEnvironment = isInEnvironment;
6 }
7
8 apply(compiler) {
9 compiler.hooks.done.tap("testPlugin", () => {
10 if (!isInProcess && this.isInEnvironment) {
11 console.log("PASS");
12 } else {
13 console.log("FAIL");
14 }
15 });
16 }
17}
18
19module.exports = (env) => ({
20 mode: "development",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected