brocessing / kirby-webpack

:muscle: A Kirby CMS starter-kit with modern frontend tools
MIT License
179 stars 23 forks source link

kirby-next support #41

Closed bnomei closed 5 years ago

bnomei commented 6 years ago

I am fooling around with kirby next and your awsome kirby-webpack (version pre-release 0.8.0). this is what i did.

but i am stuck at getting browsersync to work. it gets loaded but does not use the hot-reload files but plain css/js files.

probably since i can not set the url in kirby next config (yet, since c helper class does not exist anymore). but maybe thats not necessary with kirby next's new server classes.

i hope you can give me a pointer how to solve this. thanks.

pqml commented 6 years ago

Hi,

The url set in the config is really important for kirby-webpack to work, so it might be it

Currently none of us dispose of the Kirby 3 fellowship package and unfortunately we lack of time to try kirby-webpack with Kirby next.. We will surely work on this when kirby next will be released, but I think it will be better to do a full rewriting on another branch (with a proper kpm package for the plugin manager and the integration of the latest webpack 4 features)

I leave this issue open to anyone to contribute to!

movingwater commented 6 years ago

hi @bnomei I just mangaged to get kirby3 running with this webpack plugin. Did everything you did and added the url in the config inside the if statement like this:

return [ 'url' => ... ];

so now it works great.

bnomei commented 6 years ago

@movingwater thanks for letting me know.

joernroeder commented 6 years ago

@movingwater do you have your working version in a repo somewhere? i would love to play around with k-next and this as well :)

movingwater commented 6 years ago

Hi @joernroeder. Unforunatly I have just a private repo. But I think its really easy change the steps like @bnomei did. Then add the url in the config file like this:

if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] === 'webpack') {
    return [
        'url' =>  $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['HTTP_X_FORWARDED_HOST'],
    ];
}

I also excluded the core and panel modules in kirby.config.json so it doesn't update/add kirby 2. Then I just manually copied Kirby 3 in my www folder. Hope this does help?

perpetualgrimace commented 5 years ago

Will this be updated now that Kirby 3 is officially out?

arnaudjuracek commented 5 years ago

Will this be updated now that Kirby 3 is official out?

Yes it will.

tststs commented 5 years ago

@joernroeder here are the changes to migrate to Kirby 3. No guarantees that this is the complete list of changes. I didn't test everything.

https://github.com/tststs/kirby-webpack/commit/6d91ff5169b0727d41fc23d6b34e9607c03e8739

Feel free to cherry pick whatever you need.

arnaudjuracek commented 5 years ago

@tststs, @bnomei I just created a Kirby 3 branch partially based on your fork. Feel free to PR if you want to add things.

Once properly tested, this branch will be merged in the main repository.