PHPackages                             makinacorpus/vite-bundle - 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. makinacorpus/vite-bundle

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

makinacorpus/vite-bundle
========================

Helps with Vite generated app Twig integration, no less, no more ("Vite fait, bien fait").

2.0.0(2y ago)11.4kGPL-2.0-or-laterPHPPHP &gt;=7.4

Since Nov 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/makinacorpus/vite-bundle)[ Packagist](https://packagist.org/packages/makinacorpus/vite-bundle)[ RSS](/packages/makinacorpus-vite-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Vite integration
================

[](#vite-integration)

Helps with Vite generated app Twig integration, no less, no more ("Vite fait, bien fait").

Basic usage:

- install it,
- create one or many vite applications, or a single one with multiple entry points (really, your architecture or methodology doesn't matter),
- copy or set the output build path for each app each in its own directory under the Symfony `public/` directory,
- register each application `manifest.json` file in this bundle configuration,
- use `{{ vite_head('app_name') }}` and `{{ vite_body('app_name') }}` in pages you need it.

Twig functions are opiniated and will include the app as a Javascript module.

If your kernel current environment is `dev`, it will include a link toward the development server instead. For this to work, you need to have Vite running.

Packages does not specify and Symfony dependency or version constraint. It should in theory work with any 6.0 and 7.0 version.

Setup
=====

[](#setup)

Install it
----------

[](#install-it)

Simply:

```
composer require makinacorpus/vite-bundle
```

Then add into your `config/bundles.php` file:

```
