Oc Vite Plugin

screenshot of Oc Vite Plugin

Vite integration for October CMS

Overview

Integrating Vite into October CMS can significantly enhance your development process, particularly when managing theme assets. This plugin is designed for seamless compatibility with October CMS versions 3 and above, making it a valuable tool for developers looking to optimize their workflow. By bridging the gap between Vite's powerful asset bundling capabilities and October CMS's flexible structure, you can enjoy a smoother, more efficient development experience.

Setting up the Vite integration requires a few straightforward steps. Once installed via composer, you'll need to configure it with your VITE_MANIFEST environmental variable and integrate specific tags into your layout. This allows you to include assets accurately and leverage Vite’s features efficiently—whether in development or production.

Features

  • Simple Installation: Easily integrate Vite with October CMS using a straightforward composer installation process.
  • Environment Configuration: Automatically detect development environments and adjust the asset inclusion based on local or production settings.
  • Asset Inclusion Flexibility: Use the vite() function in Twig to include assets from either the Vite Dev Server or the production manifest.
  • Customization of Output: By adjusting parameters, you can determine whether assets are directly output in markup or pushed through October's asset pipeline.
  • Adaptable Workflow: Utilize Vite commands to manage development and production asset handling, streamlining the build process.
  • Support for Additional Attributes: Pass extra attributes within the vite() function for custom HTML tag generation.
  • PHP Integration: Include assets in your PHP code using a special vite: token, enhancing flexibility in asset management.
  • Streamlined Layout Management: Remember to incorporate the {% styles %} and {% scripts %} tags to ensure assets load correctly in your layouts.