- Issue created by @wotnak
- πΊπΈUnited States mortona2k Seattle
Elevating the priority because this is going to be a problem for people who want to update when 10.3 comes out. Critical may be appropriate for this.
I tried updating the code to change the paths for the new component library names, but it didn't work to change the final library definition.
Drupal\Core\Asset\LibraryDiscoveryParser->librariesForComponents() is where it builds components.all.
I'm looking into available hooks for overriding that - any other ideas?
- Status changed to Needs review
5 months ago 10:06pm 16 June 2024 - πΊπΈUnited States mortona2k Seattle
Figured it out. Just got this working, so needs some testing.
- π¦πΉAustria mvonfrie
The documentation regarding the Vite configuration example needs to be updated as well.
* in `<theme>/vite.config.ts`: ```diff import { defineConfig } from "vite" import multiInput from "rollup-plugin-multi-input" export default defineConfig({ plugins: [multiInput.default()], build: { manifest: true, rollupOptions: { input: [ [...] + "components/**/*.pcss.css", + "components/**/*.ts", ], }, }, [...] }) ```
The
import multiInput from "rollup-plugin-multi-input"
and then loading the plugin withmultiInput.default()
no longer works for me> I'm getting the following error:You must supply options.input to rollup
If I change this to
multiInput()
as in the examples from the rollup-plugin-multi-input repo itself, I get another error:failed to load config from /var/www/html/vite.config.js
error during build:
TypeError: multiInput is not a functionI don't have a solution for this yet.
Version info:
Node 18.20 or 20.14.8
Yarn: 4.3.0
Vite: 5.3.1
Typescript: 5.2.2
rollup-plugin-multi-input: 1.4.1 - πΊπΈUnited States mortona2k Seattle
Here's what I got:
build: { outDir: "dist", emptyOutDir: true, manifest: true, rollupOptions: { watch: true, input: [ ...globSync('libraries/*/*.{css,js}'), # <-- single asterisk to only include top level files in directories. ...globSync('components/**/*.{css,js}'), ...globSync('layouts/**/*.{css,js}'), ], output: { entryFileNames: `[name].js`, assetFileNames: `[name].[ext]`, }, }, },
- Status changed to Needs work
5 months ago 2:06pm 29 June 2024 - π΅π±Poland wotnak
@mvonfrie
The import multiInput from "rollup-plugin-multi-input" and then loading the plugin with multiInput.default() no longer works for me> I'm getting the following error:
You must supply options.input to rollup
Do you have at least one source file that matches paths from `build.rollupOptions.input`? I once encountered that error when trying to run build without actually having any files to build, after creating at least one, even empty, file that matches configured paths everything worked fine.
- π¦πΉAustria mvonfrie
@wotnak, at first not but then I created a file with simple test code. No change.
But I've skipped this approach due to other problems with Vite itself. Read https://www.drupal.org/project/vite/issues/3349311#comment-15657697 π Example configurations/starting points Active to see how I configured it for now.
- π¦πΉAustria mvonfrie
MR !13 has a conflict with β¨ Allow enabling vite for all components and libraries in theme/module RTBC which is already RTBC.
- π¬π§United Kingdom chrisscrumping
I am using this patch and seems to be working
-
wotnak β
committed 8eb18db9 on 1.x
Issue #3448606 by wotnak, mortona2k, mvonfrie: Drupal 10.3 SDC...
-
wotnak β
committed 8eb18db9 on 1.x
- Status changed to RTBC
3 months ago 4:08pm 5 August 2024 - Issue was unassigned.
- Status changed to Fixed
3 months ago 4:29pm 5 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.