Download the PHP package offline/oc-vite-plugin without Composer

On this page you can find all versions of the php package offline/oc-vite-plugin. 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 oc-vite-plugin

Vite ⚡integration for October CMS

This plugin provides simple integration of Vite for October CMS (Versions 3+).

Setup

Install the plugin using composer

For the Vite integration to work, you first need to set the VITE_MANIFEST env variable to the path of the manifest file generated by Vite.

Then make sure to place the {% styles %} and {% scripts %} tags in your layout, so assets are included correctly.

Configuring Vite

Install Vite via npm in your theme.

You can adapt the following Vite configuration to bundle your theme assets:

Workflow

Including Vite Assets

Use the vite() function anywhere in Twig to include assets from the Vite Dev Server or the Vite manifest.json (depending on the environment).

You must provide an array of files to include as the first argument. All paths are relative to the theme directory.

By default, the vite() function will output the required assets to your markup directly.

Using October's asset pipeline

If you want to push assets to October's asset pipeline instead, you can set the render parameter to false. No output will be generated where the vite() function was called in this case.

Remember to place the {% styles %} and {% scripts %} tags in your layout, for this to work.

Passing in additional attributes

Any additional attributes will be passed to the generated HTML tag.

Including assets from PHP code

You can use a special vite: token to include files in PHP:

The asset will now be included using October's asset pipeline and output wherever you have placed the {% scripts %} and {% styles %} tag.

Environments

Dev

By default, local and dev are regarded as dev environments. If your app environment is a dev environment, the Vite Dev Server will automatically be included for you.

You can use the following .env variables to configure how the Vite Dev Server is included:

Production

If your app is configured to be run in a production environment, the plugin will automatically use the Vite manifest to include assets.


All versions of oc-vite-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-json Version *
composer/installers Version ~1.0
october/rain Version ^3.0
laravel/framework Version ^9.0|^10.0
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 offline/oc-vite-plugin contains the following files

Loading the files please wait ....