Download the PHP package k10r/vite-encore without Composer

On this page you can find all versions of the php package k10r/vite-encore. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vite-encore

ViteEncore Bundle

This Symfony bundle assists with the integration of Vite by providing Twig functions to render assets based on Vite's manifest.json or its dev server.

Requirements

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

Installation

Install the bundle by running:

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

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

Configuration

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

Vite

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

From there on, you can adjust the configuration as you see fit. For more information on how to configure Vite, see the official documentation.

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

Symfony

In order to change the default configuration, a k10r_vite_encore.yaml can be created inside the <project-root>/config/packages directory.

The default configuration is as follows:

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

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

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

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

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

This project adheres to Semantic Versioning. Please refer to the CHANGELOG.md for detailed changes and migration instructions.

License

MIT


All versions of vite-encore with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
symfony/config Version ^4.4 || ^5.0 || ^6.0
symfony/dependency-injection Version ^4.4 || ^5.0 || ^6.0
symfony/http-kernel Version ^4.4 || ^5.0 || ^6.0
symfony/framework-bundle Version ^4.4 || ^5.0 || ^6.0
symfony/twig-bundle Version ^4.4 || ^5.0 || ^6.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package k10r/vite-encore contains the following files

Loading the files please wait ....