Home / Function/ onEmit() — vue Function Reference

onEmit() — vue Function Reference

Architecture documentation for the onEmit() function in util.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  f535a975_7845_514b_b6ff_17229ed679d1["onEmit()"]
  99a6affb_d8d8_b016_2ca6_5459e015e0f9["util.ts"]
  f535a975_7845_514b_b6ff_17229ed679d1 -->|defined in| 99a6affb_d8d8_b016_2ca6_5459e015e0f9
  cbcadca6_4ebf_6255_caf8_59eb024b085c["apply()"]
  cbcadca6_4ebf_6255_caf8_59eb024b085c -->|calls| f535a975_7845_514b_b6ff_17229ed679d1
  a49da80f_b793_f663_40e5_6baf1d842252["apply()"]
  a49da80f_b793_f663_40e5_6baf1d842252 -->|calls| f535a975_7845_514b_b6ff_17229ed679d1
  style f535a975_7845_514b_b6ff_17229ed679d1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/webpack-plugin/util.ts lines 35–58

export const onEmit = (compiler, name, stageName, hook) => {
  if (isWebpack5) {
    // Webpack >= 5.0.0
    compiler.hooks.compilation.tap(name, compilation => {
      if (compilation.compiler !== compiler) {
        // Ignore child compilers
        return
      }
      const stage = webpack.Compilation[stageName]
      compilation.hooks.processAssets.tapAsync(
        { name, stage },
        (assets, cb) => {
          hook(compilation, cb)
        }
      )
    })
  } else if (compiler.hooks) {
    // Webpack >= 4.0.0
    compiler.hooks.emit.tapAsync(name, hook)
  } else {
    // Webpack < 4.0.0
    compiler.plugin('emit', hook)
  }
}

Subdomains

Called By

Frequently Asked Questions

What does onEmit() do?
onEmit() is a function in the vue codebase, defined in packages/server-renderer/src/webpack-plugin/util.ts.
Where is onEmit() defined?
onEmit() is defined in packages/server-renderer/src/webpack-plugin/util.ts at line 35.
What calls onEmit()?
onEmit() is called by 2 function(s): apply, apply.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free