PHPackages                             k10r/vite-encore - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. k10r/vite-encore

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

k10r/vite-encore
================

Webpack encore like entrypoint loader for ViteJS

0.1.1(3y ago)9549MITPHPPHP ^7.4|^8.0

Since Oct 14Pushed 3y ago4 watchersCompare

[ Source](https://github.com/kellerkinderDE/vite-encore-bundle)[ Packagist](https://packagist.org/packages/k10r/vite-encore)[ RSS](/packages/k10r-vite-encore/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (3)Used By (0)

ViteEncore Bundle
=================

[](#viteencore-bundle)

This Symfony bundle assists with the integration of [Vite](https://vitejs.dev)by providing Twig functions to render assets based on Vite's `manifest.json` or its dev server.

Requirements
------------

[](#requirements)

In order to use this bundle, your project has to fulfill the following requirements:

- Symfony `^4.4 || ^5.0 || ^6.0`

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

[](#installation)

Install the bundle by running:

```
composer require k10r/vite-encore

```

Now, register the bundle in your `config/bundles.php`:

```
return [
    // ...
    K10r\ViteEncoreBundle\K10rViteEncoreBundle::class => ['all' => true],
];
```

If you have not installed Vite, yet, do so by running:

```
npm install -D vite

```

Configuration
-------------

[](#configuration)

Configuring the bundle consists of two parts: Vite and Symfony. The latter part is optional, since this bundle already provides reasonable defaults.

Vite
----

[](#vite)

Start by creating a `vite.config.js` file inside your project's root directory and populate it with the following content:

```
import { defineConfig } from 'vite';
import { resolve } from 'path';

export default defineConfig({
    root: 'assets',
    base: '/dist/',

    build: {
        outDir: resolve(__dirname, 'public/dist'),
        emptyOutDir: true,
        manifest: true,
        target: 'es2018',
        rollupOptions: {
            input: '/js/app.js'
        },
    },

    server: {
        cors: true,
        strictPort: true,
        port: 3000,
    },
});
```

From there on, you can adjust the configuration as you see fit. For more information on how to configure Vite, see the [official documentation](https://vitejs.dev/config/).

To make the above configuration work with your project, you want to create an `app.js` inside the `/assets/js` directory or adjust the `root`and `build.rollupOptions.input` options inside the config.

Symfony
-------

[](#symfony)

In order to change the default configuration, a `k10r_vite_encore.yaml` can be created inside the `/config/packages` directory.

The default configuration is as follows:

```
# config/packages/k10r_vite_encore.yaml
k10r_vite_encore:
    base: /dist/
    server:
        enabled: true
        host: localhost
        port: 3000
        https: false
```

### Options

[](#options)

`base` - string

This option tells Symfony where to find the bundled assets, relative to the `public` directory. The value has to be equal to the `root` option inside the Vite config, as well as match the final path fragment of the `build.outDir` option.

`server.enabled` - bool

This option controls, if the Vite dev server should be used, when the project is launched with `APP_ENV=dev`. This requires the development server to be started.

`server.host` - string

This options controls, which hostname is used to query assets from the development server. It should correspond to the IP/hostname on which the development server will be running.

`server.port` - int

This option controls, which port is used to access the development server. It should correspond to the `server.port` option from the Vite configuration.

`server.https` - bool

This options controls, if the development server should be accessed via https.

Usage
-----

[](#usage)

In order to include your bundled assets, use the following Twig functions for scripts and styles respectively:

```
{{ vite_style_entry('js/app.js') }}
{{ vite_script_entry('js/app.js') }}
```

The `js/app.js` is the entrypoint corresponding to the Vite configuration provided above. It as to correspond to the `build.rollupOptions.input` value without trailing slashes.

### Using the development server

[](#using-the-development-server)

You can launch the development server by running `npx vite` or creating an alias script inside your `package.json` to run `vite`.

### Building for production

[](#building-for-production)

If you want to build for production, use the command `npx vite build` or do so by creating an alias script inside your `package.json` to execute `vite build`.

Changelog
---------

[](#changelog)

This project adheres to [Semantic Versioning](https://semver.org/). Please refer to the [CHANGELOG.md](CHANGELOG.md) for detailed changes and migration instructions.

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

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

Every ~398 days

Total

2

Last Release

1270d ago

PHP version history (2 changes)0.1.0PHP ^7.4

0.1.1PHP ^7.4|^8.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/3cb3cb3341c1d1cfa2e2ac75fffcc2fc5ab5e1004ce7ba4da1e41a6ac42e2ea1?d=identicon)[kleinmann](/maintainers/kleinmann)

---

Top Contributors

[![kleinmann](https://avatars.githubusercontent.com/u/85701?v=4)](https://github.com/kleinmann "kleinmann (2 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/k10r-vite-encore/health.svg)

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

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M564](/packages/symfony-maker-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[sulu/sulu

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

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

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[scheb/2fa-bundle

A generic interface to implement two-factor authentication in Symfony applications

6914.0M61](/packages/scheb-2fa-bundle)

PHPackages © 2026

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