This is basically just a mix() helper function for CSS and JS files versioned by Laravel Mix. I immediately fell in love with Laravel Mix and wanted to have the mix() function inside my Kirby snippets.
As this is my first plugin I would love to get some feedback. I’m actually more of a frontend developer and not that experienced with this kind of stuff. Any kind of help would be very appreciated
Thanks for the hint, @jenstornell. I haven’t thought about that to be honest. Although I guess (or wish) that if Kirby uses that option in the future it’ll mean that Laravel Mix will be included as a default and thus making my plugin obsolete. But that’s probably never gonna happen. Still, one can dream
@funkybrotha Unfortunately I can’t get it to work. I’ve never developed a Composer package so I have absolutely no idea where to start with this Maybe I can continue when the plugin part of the Kirby documentation is more complete. I actually need this for my own projects, so I will definitely keep an eye on this!
The composer stuff isn’t compulsory. You could get it working without all that, it just means people have to manually install it the old way by downloading it and dropping it into the plugins folder. Your plugin isn’t especially complex as far as i can tell, it just needs wrapping in the new style plugin declaration, and a small tweak to the way you get options from the config.
first, @lukasbestle great to hear that the docs are updated. Thanks for your great work
@bnomei I will definitely look into that and see what has to be updated. But as @jimbobrjames pointed out, the plugin is really simple — I’d say it’s the definition of “simple” — and that’s of course by design. But I still want it to behave the way one would expect it, which includes being installable any way you want.
@RobertC Good stuff! I happen to use mix too, so I will give it a try as well. But, forgive me, I don’t actually see what this plugin does, other then create a link to the JS & CSS in the template? This works just fine with the standard Kirby helpers, and Browsersync happily live reloads it after Mix compiles the code. Am i missing something? Does your plugin carry through the mix versioning?
Not true. You can feed it as many source files as you like and it will spit them combined into one file… unless that isnt what you meant? Ive never tried to feed it something like src\js\*.js