integrated vuejs with vitejs and hmr to drupal theme

This commit is contained in:
2024-07-15 16:34:28 +02:00
parent 5bd2fc7ee0
commit b4077639be
26 changed files with 1645 additions and 2347 deletions

View File

@@ -2,14 +2,23 @@
/**
* @file
* Functions to support theming in the reha theme.
* Functions to support theming in the caravane theme.
*/
function caravane_page_attachments_alter(&$page) {
if (getenv('APP_ENV') === 'development') {
// $attachments['#attached']['html_head'][] = [['src' => 'http://localhost:5173/@vite/client', 'type' => 'module'],'vite-client'];
// $page['#attached']['library'][] = 'http://localhost:5173/@vite/client';
// $attachments['#attached']['html_head'][] = [['src' => 'http://localhost:5173/assets/js/main.js', 'type' => 'module'],'vite-main'];
// $page['#attached']['library'][] = 'http://localhost:5173/assets/js/main.js';
$page['#attached']['library'][] = 'caravane/vitehmr';
}
}
/**
* Implements hook_preprocess_HOOK() for html.html.twig.
*/
function caravane_preprocess_html(&$variables) {
}
/**