Home / File/ urls.test.ts — tailwindcss Source File

urls.test.ts — tailwindcss Source File

Architecture documentation for urls.test.ts, a typescript file in the tailwindcss codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  4209a852_d05f_56e9_0381_957b4155b649["urls.test.ts"]
  95a806ab_8556_4112_9786_fda4ff23eeca["urls.ts"]
  4209a852_d05f_56e9_0381_957b4155b649 --> 95a806ab_8556_4112_9786_fda4ff23eeca
  7ac5591b_df87_a0ae_2005_4d18e64a288f["rewriteUrls"]
  4209a852_d05f_56e9_0381_957b4155b649 --> 7ac5591b_df87_a0ae_2005_4d18e64a288f
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  4209a852_d05f_56e9_0381_957b4155b649 --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  style 4209a852_d05f_56e9_0381_957b4155b649 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect, test } from 'vitest'
import { rewriteUrls } from './urls'

const css = String.raw

test('URLs can be rewritten', async () => {
  let root = '/root'

  let result = await rewriteUrls({
    root,
    base: '/root/foo/bar',
    // prettier-ignore
    css: css`
      .foo {
        /* Relative URLs: replaced */
        background: url(./image.jpg);
        background: url(../image.jpg);
        background: url('./image.jpg');
        background: url("./image.jpg");

        /* Absolute URLs: ignored */
        background: url(/image.jpg);
        background: url(/foo/image.jpg);
        background: url('/image.jpg');
        background: url("/image.jpg");

        /* Potentially Vite-aliased URLs: ignored */
        background: url(~/image.jpg);
        background: url(~/foo/image.jpg);
        background: url('~/image.jpg');
        background: url("~/image.jpg");
        background: url(#/image.jpg);
        background: url(#/foo/image.jpg);
        background: url('#/image.jpg');
        background: url("#/image.jpg");
        background: url(@/image.jpg);
        background: url(@/foo/image.jpg);
        background: url('@/image.jpg');
        background: url("@/image.jpg");

        /* External URL: ignored */
        background: url(http://example.com/image.jpg);
        background: url('http://example.com/image.jpg');
        background: url("http://example.com/image.jpg");

        /* Data URI: ignored */
        /* background: url(data:image/png;base64,abc==); */
        background: url('data:image/png;base64,abc==');
        background: url("data:image/png;base64,abc==");

        /* Function calls: ignored */
        background: url(var(--foo));
        background: url(var(--foo, './image.jpg'));
        background: url(var(--foo, "./image.jpg"));

        /* Fragments: ignored */
        background: url(#dont-touch-this);

        /* Image Sets - Raw URL: replaced */
        background: image-set(
// ... (104 more lines)

Domain

Dependencies

Frequently Asked Questions

What does urls.test.ts do?
urls.test.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the NodeServer domain.
What does urls.test.ts depend on?
urls.test.ts imports 3 module(s): rewriteUrls, urls.ts, vitest.
Where is urls.test.ts in the architecture?
urls.test.ts is located at packages/@tailwindcss-node/src/urls.test.ts (domain: NodeServer, directory: packages/@tailwindcss-node/src).

Analyze Your Own Codebase

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

Try Supermodel Free