Skip to content
Snippets Groups Projects
Commit b366dfb9 authored by catch's avatar catch
Browse files

Issue #3498073 by nicxvan: Manually convert unversioned_assets_test_library_info_alter

parent e444db87
No related branches found
No related tags found
No related merge requests found
<?php
declare(strict_types=1);
namespace Drupal\unversioned_assets_test\Hook;
use Drupal\Core\Hook\Attribute\Hook;
/**
* Hook implementations for unversioned_assets_test.
*/
class UnversionedAssetsTestHooks {
/**
* Implements hook_library_info_alter().
*/
#[Hook('library_info_alter')]
public function libraryInfoAlter(&$libraries, $extension): void {
if ($extension === 'system') {
// Remove the version and provide an additional CSS file we can alter the
// contents of .
unset($libraries['base']['version']);
$libraries['base']['css']['component']['public://test.css'] = ['weight' => -10];
}
}
}
<?php
/**
* @file
* Helper module for unversioned asset test.
*/
declare(strict_types=1);
/**
* Implements hook_library_info_build().
*/
function unversioned_assets_test_library_info_alter(&$libraries, $extension): void {
if ($extension === 'system') {
// Remove the version and provide an additional CSS file we can alter the
// contents of .
unset($libraries['base']['version']);
$libraries['base']['css']['component']['public://test.css'] = ['weight' => -10];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment