- Issue created by @mortona2k
- Status changed to Needs review
11 months ago 6:43am 28 December 2023 - πΊπΈUnited States mortona2k Seattle
I got this working with a simple change.
In settings.php, configure vite to enable your theme:
$settings['vite'] = [ 'overrides' => [ 'vite_theme' => [ 'enabled' => true ] ] ];
In Vite.php, change line 47:
- if ($extension === 'sdc' && isset($library['vite']) && $library['vite'] === TRUE) {
+ if ($extension === 'sdc') {AssetLibrary::shouldBeManagedByVite() already has the check for vite enabled in the library, so it is unnecessary here.
- First commit to issue fork.
- Status changed to Needs work
10 months ago 5:51pm 20 January 2024 - π΅π±Poland wotnak
Change looks good, will merge it.
But first, I think it would be also good to provide an option to enable vite in all components/libraries of the theme/module right in the theme/module, so that vite configuration is contained in the theme/module it applies to and changes to settings.php aren't required for the theme/module to work.
Thinking of adding vite section to the .info.yml file that will allow enabling vite in all sdc components and/or all libraries defined in .libraries.yml, something like:
name: My theme [...] vite: enableInAllComponents: true enableInAllLibraries: true [...]
- πΊπΈUnited States mortona2k Seattle
I rebased the branch on the latest dev commit.
@wotnak we already have override module/theme/library options in settings.php. I'm assuming that should take precedence in case you want to override something from contrib.
- Merge request !12Add options of enabling vite for all components and libraries in theme/module β (Merged) created by wotnak
- Status changed to RTBC
6 months ago 2:01pm 21 May 2024 - π΅π±Poland wotnak
Marking as RTBC. Changes from https://git.drupalcode.org/project/vite/-/merge_requests/12 worked for us in internal and client projects without any problems.
-
wotnak β
committed 4bafb169 on 1.x
Issue #3411117 by mortona2k, wotnak: Allow enabling vite for all...
-
wotnak β
committed 4bafb169 on 1.x
- Status changed to Fixed
4 months ago 4:29pm 5 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.