How to use Murby?

Hi there,

I’m trying to use Murby : a development version of Kirby based on webpack. I heard a lot about webpack and I understand the basics but it’s the first time I try to use it concretely. As the documentation of Murby is very light and simple, I thought that it would make webpack easier to use. After installing it, I tried to create a new js file with a simple console.log('test') in the assets/js folder then run the npm run build command but it appears that it doesn’t automatically merged the new file to the bundle.js, as I thought. I suppose that I have to manually create entries and make all the webpack configurations that I was trying to avoid… Could anyone confirm that new files aren’t automatically targeted by Murby ?

By the way, do you know other webpack solutions for Kirby ?

Thanks

My starterkit uses webpack only for JS - see here.

… or maybe this is something for you?

Thanks @S1SYPHOS but I need the CSS to be bundled too.
Concerning Kirby-webpack, unfortunatly it isn’t available for Kirby 3.

That shouldn’t really matter much, because the webpack part should still be usable.

I read several issues related to Kirby 3 but a branch seems to adapt it properly so I’ll try.

I’m trying it and it seems to work !

1 Like

Looking good, I’m glad for you!

1 Like

Hi @Adrieng!

Of course new files aren’t loaded automagically by webpack – thats by design. You have to import files into /assets/js/index.js. That’s the entrypoint for webpack. Now they should be bundled into the final /web/assets/js/bundle.js.

More about import/export with JavaScript: https://matti.dev/post/guide-es6-imports-exports

Thanks ! Meanwhile I finally studied the functionning of webpack and managed to make it work.