(compiler)
| 10 | plugins: [ |
| 11 | { |
| 12 | apply(compiler) { |
| 13 | compiler.hooks.compilation.tap("Test", (compilation) => { |
| 14 | compilation.hooks.processAssets.tap( |
| 15 | { |
| 16 | name: "Test", |
| 17 | stage: |
| 18 | compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE |
| 19 | }, |
| 20 | (assets) => { |
| 21 | const name = "bundle0.css"; |
| 22 | const code = /** @type {string} */ (assets[name].source()); |
| 23 | |
| 24 | compilation.updateAsset( |
| 25 | name, |
| 26 | new compiler.webpack.sources.RawSource( |
| 27 | `${code.replace( |
| 28 | "head{", |
| 29 | ".class, head, body{" |
| 30 | )}\n\n.after-head { color: red; }` |
| 31 | ) |
| 32 | ); |
| 33 | } |
| 34 | ); |
| 35 | }); |
| 36 | } |
| 37 | } |
| 38 | ], |
| 39 | experiments: { |
nothing calls this directly
no test coverage detected