Skip to content
Omena
Integrations

Vite integration

Run Omena transforms through Vite while preserving explicit workspace and HMR boundaries.

Install the published plugin:

npm install --save-dev @omena/vite-plugin@0.2.1
import { defineConfig } from "vite";
import { omenaCss } from "@omena/vite-plugin";

export default defineConfig({
  plugins: [
    omenaCss({
      minify: true,
      passes: ["comment-strip", "whitespace-strip"],
    }),
  ],
});

Version 0.2.1 transforms .module.css and .module.scss by default. The repository's next adapter also includes .module.less; opt into a wider published scope with include rather than relying on unreleased behavior.

The plugin calls NAPI first and falls back to WASM. It does not spawn the CLI. Its development runtime accepts Vite HMR updates, while workspace-aware bundle passes require caller-provided sources and packageManifests.

Use an explicit include when another preprocessor owns the same file. Avoid running two transforms over one module unless their ordering and source maps are tested together.