0.1.2 • Published yesterday
@drupal-canvas/vite-plugin
Licence
MIT
Version
0.1.2
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Drupal Canvas Vite Plugin
Vite plugin for developing Drupal Canvas Code Components.
Usage
npm install -D @drupal-canvas/vite-pluginConfigure the following environment variables. You can place them in a .env
file.
| Environment variable | Description |
|---|---|
CANVAS_COMPONENT_DIR |
Directory where Code Components are stored in the filesystem. |
CANVAS_SITE_URL |
Base URL of your Drupal site. |
CANVAS_JSONAPI_PREFIX |
Optional custom prefix for JSON:API requests. Drupal core defaults to /jsonapi. |
Import the plugin in your Vite configuration:
// vite.config.js
import { defineConfig } from 'vite';
import drupalCanvas from '@drupal-canvas/vite-plugin';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react-swc';
export default defineConfig({
plugins: [react(), tailwindcss(), drupalCanvas()],
});