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

Function apply

test/configCases/module/non-webpack-require/webpack.config.js:24–57  ·  test/configCases/module/non-webpack-require/webpack.config.js::apply
(compiler)

Source from the content-addressed store, hash-verified

22 plugins: [
23 {
24 apply(compiler) {
25 compiler.hooks.compilation.tap(class="st">"Test", (compilation) => {
26 compilation.hooks.processAssets.tap(
27 {
28 name: class="st">"copy-webpack-plugin",
29 stage:
30 compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
31 },
32 () => {
33 compilation.emitAsset(
34 class="st">"mod.js",
35 new webpack.sources.RawSource(
36 class="st">"module.exports = 'module text';\n"
37 )
38 );
39 }
40 );
41 compilation.hooks.processAssets.tap(
42 {
43 name: class="st">"copy-webpack-plugin",
44 stage:
45 compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
46 },
47 () => {
48 compilation.emitAsset(
49 class="st">"node_modules/external-module/index.js",
50 new webpack.sources.RawSource(
51 class="st">"module.exports = 'external module text';\n"
52 )
53 );
54 }
55 );
56 });
57 }
58 }
59 ]
60};

Callers

nothing calls this directly

Calls 2

tapMethod · 0.80
emitAssetMethod · 0.80

Tested by

no test coverage detected