Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lhapaipai/vite-bundle
Integration with your Symfony app & Vite
https://github.com/lhapaipai/vite-bundle
bundle php symfony symfony-bundle vitejs
Last synced: 5 days ago
JSON representation
Integration with your Symfony app & Vite
- Host: GitHub
- URL: https://github.com/lhapaipai/vite-bundle
- Owner: lhapaipai
- License: mit
- Created: 2021-04-11T09:31:36.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-27T18:32:57.000Z (about 2 months ago)
- Last Synced: 2025-01-10T07:25:30.200Z (12 days ago)
- Topics: bundle, php, symfony, symfony-bundle, vitejs
- Language: PHP
- Homepage: https://symfony-vite.pentatrion.com
- Size: 315 KB
- Stars: 238
- Watchers: 9
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-vite - Vite Bundle - Integration for Symfony. (Integrations with Backends / Symfony)
- awesome-vite - Vite Bundle - Integration for Symfony. (Integrations with Backends / Symfony)
README
# ViteBundle : Symfony integration with Vite
> [!IMPORTANT]
> This repository is a "subtree split": a read-only subset of that main repository [symfony-vite-dev](https://github.com/lhapaipai/symfony-vite-dev) which delivers to packagist only the necessary code.> [!IMPORTANT]
> If you want to open issues, contribute, make PRs or consult examples you will have to go to the [symfony-vite-dev](https://github.com/lhapaipai/symfony-vite-dev) repository.This bundle helps you render all the dynamic `script` and `link` tags needed.
Essentially, it provides two twig functions to load the correct scripts into your templates.## Installation
Install the bundle with:
```console
composer require pentatrion/vite-bundle
``````bash
npm install# start your vite dev server
npm run dev
```Add these twig functions in any template or base layout where you need to include a JavaScript entry:
```twig
{% 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](https://symfony-vite.pentatrion.com).
## Ecosystem
| Package | Description |
| ----------------------------------------------------------------------- | :------------------------ |
| [vite-plugin-symfony](https://github.com/lhapaipai/vite-plugin-symfony) | Vite plugin (read-only) |
| [symfony-vite-dev](https://github.com/lhapaipai/symfony-vite-dev) | Package for contributors |## License
[MIT](LICENSE).