Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

How to build scalable micro-frontends with Vike and Vite

Blog post from LogRocket

Post Details
Company
Date Published
Author
Elijah Asaolu
Word Count
1,939
Language
-
Hacker News Points
-
Summary

Micro-frontends enable the division of large web applications into smaller, independently manageable components, inspired by microservice architecture, allowing diverse development and scaling by team members using preferred frameworks and tools. Vite, known for its fast build times, is ideal for micro-frontends, and the introduction of Vike (formerly vite-plugin-ssr) enhances the ability to build server-side rendered (SSR) applications while leveraging this architecture. This tutorial explores the use of Vike and vite-plugin-federation to create scalable micro-frontends, detailing Vike's evolution from a SSR plugin to a comprehensive framework that supports static-site generation (SSG) and integrates with various JavaScript frameworks, CSS libraries, and tools. It provides instructions on setting up a Vike project with Node.js, utilizing Bati for advanced customization, and implementing module federation via vite-plugin-federation to share components across applications. The tutorial emphasizes the potential of integrating Monorepo frameworks like Nx and Turborepo for simplifying micro-frontend management, and provides a practical example of incorporating a Vue component into a Vike-react project, demonstrating the versatility and scalability of this approach.