import type { RspackPluginFunction, RuleSetRule } from '@rspack/core'; import type { RuleInsertOptions } from './types.ts'; export interface PluginStaticAssetsOptions extends RuleInsertOptions { /** Result filename of the asset in bundle. By default `'static/[name][ext]'`. */ filename?: string; /** Options for rule by extension. Or false for disabling rule. */ byExt?: { /** Extensions to interpret as static files (without leading dot). */ extensions?: string[] | ((defaults: string[]) => string[]); /** Rule extend/override. */ ruleOverride?: RuleSetRule; } | false; /** Options for rule by import attribute. Or false for disabling rule. */ byImportAttr?: { /** Rule extend/override. */ ruleOverride?: RuleSetRule; } | false; } /** * Rspack plugin that adds support of importing files as static assets. * It just adds rules with `type: 'asset/resource'`. * * By default popular file extensions (image, audio, video) will be handled by this rule: * apng, avif, gif, jpg, jpeg, png, webp, mp3, ogg, wav, mp4, 3gp, webm. * * @param options Options. * @returns Plugin function. */ export declare function pluginStaticAssets({ filename, byExt, byImportAttr, ruleInsert, }?: PluginStaticAssetsOptions): RspackPluginFunction;