Fix path normalization for Windows compatibility

Created on 22 May 2025, 5 months ago

Problem/Motivation

When using the Vite module on a Windows system, asset paths may contain backslashes (e.g., \components\foo.pcss.css). This causes strstr() to fail when looking for /components/, breaking the path resolution.

Steps to reproduce

1. Run a Drupal site on Windows
2. Use a component with a nested path
3. Observe fatal error or incorrect behavior from strstr()

Proposed resolution

Normalize slashes before processing:

$path = str_replace('\\', '/', $path);
🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇬🇷Greece dotoree

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024