- Issue created by @aman_lnwebworks
- First commit to issue fork.
- Assigned to aman_lnwebworks
- 🇮🇳India aman_lnwebworks
Hi @sleepingmonk
For the above issue, you need to add a
stories
directory inside the
lib
directory,
And also need to update "koan_library_info_build()" function in .theme file
function koan_library_info_build() { $extensions = ['css', 'js']; $directory = 'themes/contrib/koan/lib/stories'; $libraries = []; try { // Escaping and imploding the extensions array for regex use $extensions = array_map('preg_quote', $extensions); $extensions = implode('|', $extensions); // Scanning the directory for files with the specified extensions $file_scan = \Drupal::service('file_system')->scanDirectory($directory, "/{$extensions}$/"); // Processing each file found in the directory foreach ($file_scan as $file) { $parts = explode('.', $file->filename); $extension = end($parts); switch ($extension) { case 'css': $libraries[$file->name][$extension] = [ 'component' => [ '/' . $file->uri => [], ], ]; break; case 'js': $libraries[$file->name][$extension] = [ '/' . $file->uri => [], ]; break; } } } catch (Exception $e) { // Logging the exception message to the watchdog for debugging \Drupal::logger('koan')->error('Error building library info: @message', ['@message' => $e->getMessage()]); } return $libraries; }
- 🇮🇳India aman_lnwebworks
Hi @sleepingmonk
Please review the above solution once.
Thank you !!