Download the PHP package swordfox/vite without Composer

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

Vite Silverstripe logo


Silverstripe Vite Plugin

Vite is a modern frontend build tool that provides an extremely fast development environment and bundles your code for production.

This plugin configures Vite for use with Silverstripe.

Install

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line, in the root folder of your project:

  1. Install the plugin

  2. Copy vite yml config

Make sure to set the path to images folder of your theme assetsImageFolder

You can also use extra_requirements_css, editor_css as shown in the config, in order to apply custom css to admin environment through Vite

  1. Copy vite config

You might need to update paths to your assets in vite.config.js, eg.: themes/custom/src/app.scss

  1. Prepare package.json

We need to set up package.json in our project root folder. Use it for all frontend packages. If you have one, make sure to include npm scripts follows:

and install necessary packages:

or run the command to copy example package.json from the source folder to start with

  1. Finally, run

  2. Add APP_URL to your .env with the local address of your website

How To Use

We need to include css in our head tag

<head>
  ...
  $Vite.CSS.RAW
</head>

The same goes with js requirements, but it can be included in body tag instead, at the very bottom

<body>
  ...
  $Vite.JS.RAW
</body>

Excellent! Next, let's get into a groove. For dev environment you need to run

Compiling for Production

In order to add assets in your template .ss files you can use these helpers:

$Vite.asset('themes/custom/src/images/image.jpg')

or, shortcut if you set assetsImageFolder in your vite.yml as mentioned above

$Vite.image('image.jpg')

You can also reach vite helper through SiteConfig

$SiteConfig.Vite.image('image.jpg')

Make sure to include glob import that will handle assets on npm run build. To do so, add this at the very top of your main js file. You might need to update paths or include other assets that are involved in your own build.

Don't forget to update your .gitignore by adding these

You are all set now, enjoy.


All versions of vite with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
silverstripe/framework Version ^4
silverstripe/cms Version ^4
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 swordfox/vite contains the following files

Loading the files please wait ....