nuxt-svgo
Version:
Nuxt module to load optimized SVG files as Vue components
27 lines (23 loc) • 1.05 kB
text/typescript
import { NuxtModule } from '@nuxt/schema';
import { Config } from 'svgo';
interface SvgLoaderOptions {
autoImportPath?: string | false;
/** The name of component in CapitalCase that will be used in `componentext` import type. defaults to `NuxtIcon` */
customComponent: string;
defaultImport?: 'url' | 'url_encode' | 'raw' | 'raw_optimized' | 'component' | 'skipsvgo' | 'componentext';
/** should the svg loader plugin work only if an import query is explicitly used?
* this only affects SVGs outside of `autoImportPath` */
explicitImportsOnly?: boolean;
svgo?: boolean;
svgoConfig?: Config;
}
declare const defaultSvgoConfig: Config;
type ModuleOptions = SvgLoaderOptions & {
/** Defaults to `svgo` */
componentPrefix?: string;
/** Generate TypeScript declaration for svg import queries (Vite.js only) */
dts?: boolean;
global?: boolean;
};
declare const nuxtSvgo: NuxtModule<ModuleOptions>;
export { type ModuleOptions, type SvgLoaderOptions, nuxtSvgo as default, defaultSvgoConfig };