Home / Function/ trimPlugin() — vue Function Reference

trimPlugin() — vue Function Reference

Architecture documentation for the trimPlugin() function in trim.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  e216ffaf_0c42_60ac_d6c1_19f7df757f23["trimPlugin()"]
  729601ff_0b63_2dea_6a2e_49e6f36c2012["trim.ts"]
  e216ffaf_0c42_60ac_d6c1_19f7df757f23 -->|defined in| 729601ff_0b63_2dea_6a2e_49e6f36c2012
  e630ee87_e220_092a_592c_f7079f566b16["doCompileStyle()"]
  e630ee87_e220_092a_592c_f7079f566b16 -->|calls| e216ffaf_0c42_60ac_d6c1_19f7df757f23
  style e216ffaf_0c42_60ac_d6c1_19f7df757f23 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/compiler-sfc/src/stylePlugins/trim.ts lines 3–15

const trimPlugin: PluginCreator<{}> = () => {
  return {
    postcssPlugin: 'vue-sfc-trim',
    Once(root) {
      root.walk(({ type, raws }) => {
        if (type === 'rule' || type === 'atrule') {
          if (raws.before) raws.before = '\n'
          if ('after' in raws && raws.after) raws.after = '\n'
        }
      })
    }
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does trimPlugin() do?
trimPlugin() is a function in the vue codebase, defined in packages/compiler-sfc/src/stylePlugins/trim.ts.
Where is trimPlugin() defined?
trimPlugin() is defined in packages/compiler-sfc/src/stylePlugins/trim.ts at line 3.
What calls trimPlugin()?
trimPlugin() is called by 1 function(s): doCompileStyle.

Analyze Your Own Codebase

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

Try Supermodel Free