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

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

viaevista/vite-bundle
=====================

Provide Vite.js bundling inside Twig template

v1.0.0(1y ago)12.8kMITPHPPHP &gt;=8.2

Since Jun 18Pushed 1y agoCompare

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

READMEChangelogDependencies (6)Versions (2)Used By (0)

Installation
============

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

This package does not support Symfony Flex yet.

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require viaevista/vite-bundle
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Viaevista\ViteBundle\ViaevistaViteBundle::class => ['all' => true],
];
```

### Step 3: Configure the Bundle

[](#step-3-configure-the-bundle)

Create a `viaevista_vite.yaml` file in your `config/packages` directory and configure the bundle to match your Vite.js setup.

```
viaevista_vite:
    server:
        # Enable or disable the server mode
        use_server_mode: '%env(bool:ENABLE_VITE_SERVER)%'
        # The host of your Vite.js when development server is running
        host: 'http://localhost:5173'

    # The base path configured in your Vite.js config
    base_path: '/build/'
```

### Step 4: Define your environment variables

[](#step-4-define-your-environment-variables)

In your `.env` file, define the `VITE_SERVER_MODE` variable to enable or disable the server mode.

Set 1 when your using the vite.js development server, and 0 when you have built your assets.

```
ENABLE_VITE_SERVER=0
```

### Step 5 : Configure your Vite.js

[](#step-5--configure-your-vitejs)

In the root of your Symfony project, add a `vite.config.js` with this minimal configuration for any Vite.js project.

```
import { defineConfig } from 'vite'

const sourcesFolder = './assets';
const basePath = 'build';
const input = {
    'app.js': `${sourcesFolder}/app.js`,
};

export default defineConfig({
    root: sourcesFolder,
    base: `/${basePath}/`,
    envDir: '../',
    build: {
        manifest: true,
        outDir: `../public/${basePath}`,
        rollupOptions: {
            input,
        },
    },
});
```

Change `sourcesFolder`, `basePath` and `input` to match your project.

- `sourcesFolder` is where your Js and CSS to be compiled are located. This is usually the `assets` folder in Symfony projects.
- `basePath` is the folder where Vite.js will output the compiled assets. **This should match the `base_path` configuration in the `viaevista_vite.yaml` file.**
- Add in `input` the entry points of your application,
    - Key are the input name (the name which will be used in the vite tag in your Twig views) and the value is the path to the file.

**When building your assets, compiled files should be under the Symfony `public` folder to be served by the web server.**

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

700d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/590dfa4ba3337542d938d9b691b20c94ca66e5ffc311161820ee42d649e2364f?d=identicon)[Viaevista](/maintainers/Viaevista)

---

Top Contributors

[![viapinot](https://avatars.githubusercontent.com/u/135708200?v=4)](https://github.com/viapinot "viapinot (16 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/viaevista-vite-bundle/health.svg)

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

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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