Download the PHP package viaevista/vite-bundle without Composer
On this page you can find all versions of the php package viaevista/vite-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download viaevista/vite-bundle
More information about viaevista/vite-bundle
Files in viaevista/vite-bundle
Package vite-bundle
Short Description Provide Vite.js bundling inside Twig template
License MIT
Informations about the package vite-bundle
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
This package does not support Symfony Flex yet.
Applications that don't use Symfony Flex
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:
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.
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.
Step 5 : Configure your Vite.js
In the root of your Symfony project, add a vite.config.js
with this minimal configuration for any Vite.js project.
Change sourcesFolder
, basePath
and input
to match your project.
sourcesFolder
is where your Js and CSS to be compiled are located. This is usually theassets
folder in Symfony projects.basePath
is the folder where Vite.js will output the compiled assets. This should match thebase_path
configuration in theviaevista_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.
All versions of vite-bundle with dependencies
symfony/twig-bundle Version ^7.1
twig/twig Version ^3.0
symfony/filesystem Version ^7.1