PhpDev.App
lhapaipai/vite-bundle

lhapaipai/vite-bundle

Stars: 141

Forks: 13

Pull Requests: 19

Issues: 44

Watchers: 5

Last Updated: 2023-08-31 11:58:39

Integration with your Symfony app & Vite

License: MIT License

Languages: PHP, CSS, JavaScript

https://symfony-vite.pentatrion.com

Symfony logo

ViteBundle : Symfony integration with Vite

This bundle helping you render all of the dynamic script and link tags needed. Essentially, he provides two twig functions to load the correct scripts into your templates.

Installation

Install the bundle with :

composer require pentatrion/vite-bundle
npm install

# start your vite dev server
npm run dev

Add this twig functions in any template or base layout where you need to include a JavaScript entry.

{% block stylesheets %}
    {{ vite_entry_link_tags('app') }}
{% endblock %}

{% block javascripts %}
    {{ vite_entry_script_tags('app') }}

    {# if you are using React, you have to replace with this #}
    {{ vite_entry_script_tags('app', { dependency: 'react' }) }}
{% endblock %}

Read the Docs to Learn More.

Ecosystem

Package Description
vite-bundle Symfony Bundle
vite-plugin-symfony Vite plugin
symfony-vite-docs Documentation
symfony-vite-dev Package for contributors

License

MIT.

RELEASES

See all