Download the PHP package atwx/silverstripe-vitehelper without Composer

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

Simple Vite Helper for Silverstripe

This module helps you to use vite in your Silverstripe project. When you have a normal vite build, you have hashed filenames. This module helps you to get the correct file names from the manifest.json.

Installation

Usage

In your template, you can use the following code

The $ViteClient.RAW will load the vite client. This is needed for the dev server. The $Vite will get the correct file name for the given input file from the manifest.json.

Configuration

You can configure the location of the build files in your mysite.yml:

The manifest_path is the path to the manifest file generated by vite. The output_url is the url to the output folder. It will be prepended with the resources folder name, normally _resources.

Dev Mode

To use vite in dev mode, set the dev server url in your .env:

Under DDEV this is optional: if VITE_DEV_SERVER_URL is not set, the helper falls back to DDEV_PRIMARY_URL_WITHOUT_PORT + :5173.

Editor CSS

As the build files have hashes, the module needs to get the correct file name for the editor css.

You can use the following in your mysite.yml to get the correct file name:

Vite Config

Our default config for vite defines:

Important is the base option. If you don't set this, the default is / which will likely not work.

Working With Themes

See Config Templates for an example that works with themes and has also TailwindCSS configured.

You need to tell vite where your theme is located, e.g. in your app/_config/themes.yml:

In your theme you can include Vite like:

Note: The paths need to match the rollupOptions in your vite.config.js.

Developing With DDEV

If you have ddev running, please export the relevant ports in your .ddev/config.yml:

For DDEV the dev server needs to listen on 0.0.0.0 and emit absolute asset URLs (the page is served from a different origin than Vite). A minimal vite.config.js:

publicDir: false is important. Vite registers publicDir as an extra watch path. When it lies under the project root (the Silverstripe default), chokidar's recursive scan breaks and HMR stops firing for files in app/client/src. Set publicDir: false (Silverstripe serves static assets itself) or point it to a directory outside the project root.

Thanks to

This module is inspired by https://github.com/brandcom/silverstripe-vite


All versions of silverstripe-vitehelper with dependencies

PHP Build Version
Package 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 atwx/silverstripe-vitehelper contains the following files

Loading the files please wait ...