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
  2174cd98_3b16_a968_380b_35f7ea8b944e["trimPlugin()"]
  a8e4176a_85a7_66ad_a2b0_98c89cfc57f1["doCompileStyle()"]
  a8e4176a_85a7_66ad_a2b0_98c89cfc57f1 -->|calls| 2174cd98_3b16_a968_380b_35f7ea8b944e
  style 2174cd98_3b16_a968_380b_35f7ea8b944e 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.
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