Vite Plugin TYPO3

raw JSON →
3.0.0 verified Mon Apr 27 auth: no javascript

Vite plugin for collecting and bundling entry points from TYPO3 extensions in a Composer-based TYPO3 setup. Version 3.0.0 adds support for Vite 8, drops CommonJS (ESM-only), and requires vite_asset_collector v1.16.0+. Provides automatic alias creation (EXT:/@), CORS defaults, and watcher ignore lists. Flexible configuration for project or extension mode. Actively maintained with monthly releases.

error Error: The plugin 'vite-plugin-typo3' doesn't appear to be a valid Vite plugin.
cause Using an outdated Vite version (<7) or conflicting plugin interface.
fix
Update Vite to ^7.0 (or ^8.0) which is the peer dependency for v3.
error Cannot find module 'vite-plugin-typo3'
cause Package not installed or missing from package.json.
fix
Run 'npm install --save-dev vite-plugin-typo3' and ensure your project root contains node_modules.
error The requested module 'vite-plugin-typo3' does not provide an export named 'getDefaultAllowedOrigins'
cause Using named import from a CJS context or incorrect version.
fix
Use ESM in your config file (e.g., .mjs or type: module) and ensure v3.0.0+.
breaking Dropped support for CommonJS. require() will fail.
fix Use ESM imports (import typo3 from 'vite-plugin-typo3').
breaking Requires vite_asset_collector v1.16.0+ and Vite 7 or 8.
fix Update vite_asset_collector TYPO3 extension to v1.16.0 and update Vite to ^7.0 || ^8.0.
breaking Strict CORS rules applied by default (v2+).
fix Add custom origins via server.cors.origin using getDefaultAllowedOrigins() as a base.
gotcha Entrypoint file default path is Configuration/ViteEntrypoints.json (not ViteEntrypoints.json).
fix Place the JSON file at EXT:my_extension/Configuration/ViteEntrypoints.json or set custom path via entrypointFile option.
gotcha Aliases are only created for installed extensions with valid composer.json.
fix Ensure TYPO3 extension has proper composer.json in its root.
npm install vite-plugin-typo3
yarn add vite-plugin-typo3
pnpm add vite-plugin-typo3

Minimal vite.config setup that integrates TYPO3 extension entry points. Requires EXT:my_extension/Configuration/ViteEntrypoints.json for actual entry collection.

import { defineConfig } from 'vite';
import typo3 from 'vite-plugin-typo3';

export default defineConfig({
  plugins: [typo3()],
});