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
  67bc246a_b935_05a8_c244_11f687e4f578["onEmit()"]
  a4aaa23d_d810_1245_8cde_5c37b4bd3875["util.ts"]
  67bc246a_b935_05a8_c244_11f687e4f578 -->|defined in| a4aaa23d_d810_1245_8cde_5c37b4bd3875
  ad95ac41_077e_09d3_ca71_cac40d4008b4["apply()"]
  ad95ac41_077e_09d3_ca71_cac40d4008b4 -->|calls| 67bc246a_b935_05a8_c244_11f687e4f578
  dbfa2018_ca28_4a7e_bd4e_3f2e5fcb1d8a["apply()"]
  dbfa2018_ca28_4a7e_bd4e_3f2e5fcb1d8a -->|calls| 67bc246a_b935_05a8_c244_11f687e4f578
  style 67bc246a_b935_05a8_c244_11f687e4f578 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