Home / Function/ wrapIIFEBabelPlugin() — vite Function Reference

wrapIIFEBabelPlugin() — vite Function Reference

Architecture documentation for the wrapIIFEBabelPlugin() function in index.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  48fb5018_fd41_a067_fb87_1ef4d68f67fb["wrapIIFEBabelPlugin()"]
  9776ecb6_00c0_b3b9_b3f7_177fedabeacc["index.ts"]
  48fb5018_fd41_a067_fb87_1ef4d68f67fb -->|defined in| 9776ecb6_00c0_b3b9_b3f7_177fedabeacc
  cf21e8d8_cce6_30a7_7732_696ed5cdf103["viteLegacyPlugin()"]
  cf21e8d8_cce6_30a7_7732_696ed5cdf103 -->|calls| 48fb5018_fd41_a067_fb87_1ef4d68f67fb
  style 48fb5018_fd41_a067_fb87_1ef4d68f67fb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/plugin-legacy/src/index.ts lines 1032–1046

function wrapIIFEBabelPlugin(): BabelPlugin {
  return ({ types: t, template }): BabelPlugin => {
    const buildIIFE = template(';(function(){%%body%%})();')

    return {
      name: 'vite-wrap-iife',
      post({ path }) {
        if (!this.isWrapped) {
          this.isWrapped = true
          path.replaceWith(t.program(buildIIFE({ body: path.node.body })))
        }
      },
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does wrapIIFEBabelPlugin() do?
wrapIIFEBabelPlugin() is a function in the vite codebase, defined in packages/plugin-legacy/src/index.ts.
Where is wrapIIFEBabelPlugin() defined?
wrapIIFEBabelPlugin() is defined in packages/plugin-legacy/src/index.ts at line 1032.
What calls wrapIIFEBabelPlugin()?
wrapIIFEBabelPlugin() is called by 1 function(s): viteLegacyPlugin.

Analyze Your Own Codebase

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

Try Supermodel Free