Home / Function/ testInjectUrl() — vite Function Reference

testInjectUrl() — vite Function Reference

Architecture documentation for the testInjectUrl() function in postcss.config.js from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  c96ac367_7123_911e_71e5_aa6a523fa666["testInjectUrl()"]
  6432e4e3_1309_4b33_9744_036f5048ffb8["postcss.config.js"]
  c96ac367_7123_911e_71e5_aa6a523fa666 -->|defined in| 6432e4e3_1309_4b33_9744_036f5048ffb8
  style c96ac367_7123_911e_71e5_aa6a523fa666 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

playground/css/postcss.config.js lines 65–84

function testInjectUrl() {
  return {
    postcssPlugin: 'inject-url',
    Once(root, { Rule }) {
      root.walkAtRules('inject-url', (atRule) => {
        const rule = new Rule({
          selector: '.inject-url',
          source: atRule.source,
        })
        rule.append({
          prop: 'background',
          value: "url('=/ok.png')",
          source: atRule.source,
        })
        atRule.after(rule)
        atRule.remove()
      })
    },
  }
}

Domain

Subdomains

Frequently Asked Questions

What does testInjectUrl() do?
testInjectUrl() is a function in the vite codebase, defined in playground/css/postcss.config.js.
Where is testInjectUrl() defined?
testInjectUrl() is defined in playground/css/postcss.config.js at line 65.

Analyze Your Own Codebase

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

Try Supermodel Free