PHPackages                             samuelmwangiw/laravel-vite - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. samuelmwangiw/laravel-vite

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

samuelmwangiw/laravel-vite
==========================

A tiny package that adds @vite\_assets blade directive and loads Vite assets

1.4.1(3y ago)41.8k1MITPHPPHP ^8.0

Since Jul 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/SamuelMwangiW/laravel-vite)[ Packagist](https://packagist.org/packages/samuelmwangiw/laravel-vite)[ Docs](https://github.com/samuelmwangiw/laravel-vite)[ RSS](/packages/samuelmwangiw-laravel-vite/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (10)Dependencies (14)Versions (17)Used By (0)

Laravel Vite
============

[](#laravel-vite)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ea6180e06046ac9a9e139526478b76b7eed4a79d933583b9686ed41d02bd763b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616d75656c6d77616e6769772f6c61726176656c2d766974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/samuelmwangiw/laravel-vite)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b97fec5e78f7495be0fbb00de85fb7df52480262fafd309d23a70f46b65ec734/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73616d75656c6d77616e6769772f6c61726176656c2d766974652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/samuelmwangiw/laravel-vite/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/760e379abd55539ed76dd720d5344597cafd92fec5ac3e6707eff5843c5483b6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73616d75656c6d77616e6769772f6c61726176656c2d766974652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/samuelmwangiw/laravel-vite/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/a5524e39814164db5b9ca29ff9a4ca0f714567555708f2a078553019192eb4b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616d75656c6d77616e6769772f6c61726176656c2d766974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/samuelmwangiw/laravel-vite)

> Since version 9.19 Laravel ships with first-party support for Vite. This package is therefore not required anymore

A tiny package that swaps out Webpack (Laravel-Mix) for Vite in you Laravel project.

This improves the developer experience by using the blazing fast Vite HMR instead of webpack compilation offered by Webpack through Laravel Mix

Installation
------------

[](#installation)

The easiest way to get started is on a new Laravel project.

- Create a new project and run the following command:

```
 laravel new awesome-project
```

- Setup [Jetstream](https://jetstream.laravel.com/2.x/installation.html#or-install-jetstream-with-inertia) with Inertia

```
  cd awesome-project
  composer require laravel/jetstream
  php artisan jetstream:install inertia
```

- or [Breeze](https://laravel.com/docs/9.x/starter-kits#laravel-breeze) with Vue

```
   cd awesome-project
   composer require laravel/breeze --dev
   php artisan breeze:install vue
```

- Then install this package via composer:

```
composer require --dev samuelmwangiw/laravel-vite
```

- Run `vite:install` command to setup vite

```
php artisan vite:install
```

- Run `npm install` to install the dependencies and `npm run dev` to start the development server
- (Optional) Since the package publishes all assets to your `App` namespace during setup, it's safe to remove the package from your dependencies

```
composer remove --dev samuelmwangiw/laravel-vite
```

- Build your amazing project

Laravel Sail
------------

[](#laravel-sail)

If running [Sail](https://laravel.com/docs/9.x/sail) for local development, this package provides a handy `sail` npm script that runs `vite --host` under the hood as `vite` is only accessible via the loopback interface (127.0.0.1) by default and would therefore not be accessible in the docker container.

```
npm run sail
```

You may optionally publish the config if you connect to the docker host running vite via a custom address/port different from `http://host.docker.internal:3000`

```
php artisan vendor:publish --provider="SamuelMwangiW\Vite\ViteServiceProvider"
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Samuel Mwangi](https://github.com/SamuelMwangiW)
- [Sebastian De Deyne](https://sebastiandedeyne.com/vite-with-laravel/) whose blog inspired this package
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 84.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~7 days

Total

14

Last Release

1431d ago

Major Versions

v0.9.999 → 1.0.02022-03-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/a61fbb91053310302b3256009b67e371e533083b8eea4ae37d3b6a9efa06e2f6?d=identicon)[SamuelMwangiW](/maintainers/SamuelMwangiW)

---

Top Contributors

[![SamuelMwangiW](https://avatars.githubusercontent.com/u/1807304?v=4)](https://github.com/SamuelMwangiW "SamuelMwangiW (93 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

laravelvitevitejslaravelvitelaravel-viteSamuelMwangiW

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/samuelmwangiw-laravel-vite/health.svg)

```
[![Health](https://phpackages.com/badges/samuelmwangiw-laravel-vite/health.svg)](https://phpackages.com/packages/samuelmwangiw-laravel-vite)
```

###  Alternatives

[ryangjchandler/blade-capture-directive

Create inline partials in your Blade templates with ease.

8222.2M12](/packages/ryangjchandler-blade-capture-directive)[spatie/laravel-blade-comments

Add debug comments to your rendered output

177325.5k](/packages/spatie-laravel-blade-comments)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[daikazu/laravel-glider

Start using Glide on-the-fly instantly in your Laravel blade templates.

882.3k](/packages/daikazu-laravel-glider)[combindma/dash-ui

A streamlined and stylish UI component library for Laravel Blade, crafted with TailwindCSS and AlpineJs for simplicity and elegance.

631.4k](/packages/combindma-dash-ui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
