# Vite Plugin

The `@fluxlay/vite` plugin configures Vite for wallpaper builds.

## Installation

<PackageManagerCommand type="add" dev packages="@fluxlay/vite" />

## Usage

```ts title="vite.config.ts"
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { fluxlay } from "@fluxlay/vite";

export default defineConfig({
  plugins: [react(), fluxlay()]
});
```

## What It Does

The plugin applies the following Vite configuration:

| Setting                                     | Value      | Purpose                                                                                 |
| ------------------------------------------- | ---------- | --------------------------------------------------------------------------------------- |
| `base`                                      | `"./"`     | Use relative paths for assets                                                           |
| `build.outDir`                              | `"dist"`   | Output directory                                                                        |
| `build.emptyOutDir`                         | `true`     | Clean output before build                                                               |
| `build.minify`                              | `"terser"` | Default — your `vite.config.ts` value (e.g. `"esbuild"` or `false`) is preserved if set |
| `build.terserOptions.compress.drop_console` | `true`     | Remove `console.*` calls                                                                |
| `build.terserOptions.mangle`                | `true`     | Mangle variable names                                                                   |

## Notes

- The plugin takes no arguments. All configuration is automatic.
- Place `fluxlay()` after other plugins (e.g., `react()`).
- Console stripping ensures no debug output leaks into published wallpapers.
