Make AssetLibrary::getExtensionBasePath() public

Created on 20 March 2025, 16 days ago

Problem/Motivation

Currently the Drupal\vite\AssetLibrary::getExtensionBasePath() method is private. This prevents features which require the extension base path which can either be [module_or_theme]/dist/ in production mode or pointing to the Vite dev server.

My use case is a Twig function to get the url of a Vite asset, optionally with an absolute path. This can be used to get the url of static assets like images or styles which are managed by Vite (if you don't want to or can use the [module_or_theme]/src/ based path for any reason. I need this for images and a CSS subset for emails sent by the site, thus with the absolute path.

Proposed resolution

Make the function public to allow further features which need outside of the AssetLibrary class.

User interface changes

None.

API changes

None.

Feature request
Status

Active

Version

1.4

Component

Code

Created by

🇦🇹Austria mvonfrie

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024