DEV Community

Cover image for Vapor 4 + Inertia + Svelte + Laravel Mix
Camilo
Camilo

Posted on

Vapor 4 + Inertia + Svelte + Laravel Mix

Wondering how can you implement Svelte and Inertia in your favourite Swift backend framework?

This is an example project so you can use the latest and greatest technologies today :)

GitHub logo NinjasCL / vapor-inertia-svelte-example

A sample Vapor 4 app made with Inertia Svelte and Laravel Mix

Vapor 4 + Svelte + Inertia + Laravel Mix

124379293 233e2080 dc84 11eb 801d 8268aaf29685

This is a sample project that implements:

The Inertia Adapter was based on https://github.com/lloople/vapor-inertia-adapter and heavily modified so it is properly working. Thats why is in Deps directory.

This is just a sample implementation. May be a better approach is possible. Please experiment and see if this works for your use case.

webpack.mix.js

The webpack.mix.js was modified in order to generate a Sources/App/mix.swift file that will contain the values of mix-manifest.json.

Modify vapor.mix.js to your needs.

Commands

  • make install: Will install npm_modules directory.

  • make webpack-watch: Will run the Laravel Mix watcher for any change inside the Resources/js directory.

  • make run: Will execute the Vapor Server.

Credits

Made with by Ninjas.cl.



Discussion (0)