Created on 18 October 2024, 6 months ago

When vite bundles css, image url() paths, they are relative to the dist directory in the theme.

However, when the css is loaded on the page by drupal, the path is relative to the web root.

The base can be set to the theme directory, but this breaks dev mode.

The workaround is to define images in css as relative to the web root. Vite build will throw an error, but it will work when loaded on the page.

This may be fixable with environment variables, a dynamic base path, or a postcss plugin.

πŸ› Bug report
Status

Active

Version

2.0

Component

Configuration

Created by

πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

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

Comments & Activities

Production build 0.71.5 2024