Download the PHP package passchn/silverstripe-vite without Composer
On this page you can find all versions of the php package passchn/silverstripe-vite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package silverstripe-vite
Silverstripe Vite Plugin
Silverstripe Version support
^0.xsupports Silverstripe 4.xdev-mastersupports Silverstripe 5.x. Note: No stable release available yet, see https://github.com/brandcom/silverstripe-vite/issues/3
Installation
In your mysite.yml:
Configuration
You can override the default config in your mysite.yml:
ViteHelper Config setting options:
- If you set
forceProductionModeto true, the build files (created after runningvite build) will be served. - Set the
devHostNeedleto distinguish your live site from your local environment, e.glocalhost:8080,mysite.testor127.0.0.1.- Note: The vite dev server must also be running.
- Set the
devPortto the port of the vite dev server, e.g.3000– the vite port will be shown in the terminal when running the dev server. To set a fixed port (recommended), remember to also set it in the vite config - underserver. The port in both configs must always match. - Define the
mainJSentry point to where your applications script file is located.- E.g., if you use TypeScript, change the
mainJsprop to"main.ts".
- E.g., if you use TypeScript, change the
- Define the
manifestDirfor where the manifest file will be located.
Usage
Insert JS / CSS tags in your main template, e.g., Page.ss:
Vite config
The config must match the vite.config.js. You need to ?flush after making changes to yml configs.
Take a look at the ViteHelper.php for more Information.
The config from your vite.config.js or vite.config.ts must match your ViteHelper config for this plugin.
See this example vite.config.ts for default configuration.
Note: When using vite below 2.9.0, the server config will be different. See this config.