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
  0595d463_c492_bf18_2219_7aebf4857c89["urls.test.ts"]
  5e3855e0_f04e_28ee_98ea_8502e6531bc8["urls.ts"]
  0595d463_c492_bf18_2219_7aebf4857c89 --> 5e3855e0_f04e_28ee_98ea_8502e6531bc8
  fa6eaba6_9ce1_3f40_275c_1ab85a97a856["rewriteUrls"]
  0595d463_c492_bf18_2219_7aebf4857c89 --> fa6eaba6_9ce1_3f40_275c_1ab85a97a856
  696bd648_5f24_1b59_8e8b_7a97a692869e["vitest"]
  0595d463_c492_bf18_2219_7aebf4857c89 --> 696bd648_5f24_1b59_8e8b_7a97a692869e
  style 0595d463_c492_bf18_2219_7aebf4857c89 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 NodeBridge 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: NodeBridge, 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