Download the PHP package bechir/vite-bundle without Composer
On this page you can find all versions of the php package bechir/vite-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bechir/vite-bundle
More information about bechir/vite-bundle
Files in bechir/vite-bundle
Package vite-bundle
Short Description Integrate Vite.js into your Symfony application
License MIT
Homepage https://github.com/bechir/vite-bundle
Informations about the package vite-bundle
This bundle allows you to integrate Vite into your Symfony application by using WebpackEncoreBundle and ViteFait
Installation
Make sure Node and a package manager (Yarn) are installed.
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:
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:
Add the bundle configuration in config/packages/bechir_vite.yaml
:
Step 3: Install ViteFait
Usage
Create vite.config.js
in the root folder and add the following code inside the file:
Add vite-fait scripts in your package.json
Then run your first build with yarn build
or npm run build
It generate entrypoints.json
file in public/dist
:
Add the twig functions in templates/base.html.twig
:
Read the vite docs for more information
Using Plugins
Read how to use vite plugins first before reading this section
Put your plugins inside the usePlugins
method:
TODO
- [ ] Add tests
- [ ] React support
- [ ] Vue support
- [ ] Documentation