@unvuetify/vite-styles-plugin
Version:
Vuetify Vite plugin for styles
45 lines (42 loc) • 1.8 kB
text/typescript
import { PluginOption } from 'vite';
interface VuetifyStylesOptions {
/**
* What CSS SASS/SCSS API should the plugin register?
* - `false` - don't register any SASS/SCSS API
* - `legacy` - use legacy SASS/SCSS API (will be removed in Vite 7)
* - `modern` - register SASS/SCSS 'modern' API => when using `sass`
* - `modern-compiler` - register SASS/SCSS 'modern-compiler' API => when using `sass-embedded`
*
* When using `modern` API, the plugin will enable `preprocessorMaxWorkers` in Vite CSS config.
*
* @default 'modern-compiler'
*
* @see https://vite.dev/config/shared-options.html#css-preprocessoroptions
* @see https://vite.dev/guide/migration.html#sass-now-uses-modern-api-by-default
*/
registerApi?: 'modern' | 'modern-compiler' | 'legacy' | false;
/**
* Mode to use for styles:
* - `none`: remove all style imports
* - `source`: import sass/scss from source (old `sass` option)
* - `configFile`: customising variables
*/
mode?: true | 'none' | 'source' | {
configFile: string;
};
/**
* Whether to use Vite SSR mode.
*
* If set to `true`, the plugin will use the Vite convention to prefix the Vuetify virtual styles.
*
* Enable this flag if you're using Vuetify with Vite and SSR without Nuxt:
* - [vite-ssg](https://github.com/antfu-collective/vite-ssg)
* - [Vitesse template](https://github.com/antfu-collective/vitesse)
* - [îles](https://github.com/ElMassimo/iles)
* - or any other framework/plugin that uses Vite and SSR
*/
viteSSR?: true;
}
declare function VuetifyStylesVitePlugin(options?: VuetifyStylesOptions): PluginOption;
export { VuetifyStylesVitePlugin };
export type { VuetifyStylesOptions };