I’ve installed a vendor library as NPM package in the storefront. The vendor provides a build script for compiling a CSS file, which you can run as NPM command. All working fine, but I’m stuck in the next step.
What I want is to include the CSS file in the main CSS of Shopware (all.css). I noticed this is defined in the ThemeCompiler class, but the functions are all private so I can’t override/extend it (or am I wrong?). I looked further and found the ThemeCompilerEnrichScssVariablesEvent, but this is only used for adding new variables and not complete files.
How can I include the build script from the vendor in the theme:compile command? Do I need to create a webpack config or are there other solutions to get this working? In the most ideal situation I just run theme:compile and in the background the NPM build script runs and includes the compiled CSS file to the main theme CSS file (all.css).
Any idea’s which approach I can follow to get this working?