@nx/rspack
Version:
37 lines (36 loc) • 1.61 kB
TypeScript
import type { Configuration } from '@rspack/core';
import { ExtraEntryPointClass } from './model';
import { NxRspackExecutionContext } from './config';
export interface WithWebOptions {
baseHref?: string;
deployUrl?: string;
extractCss?: boolean;
generateIndexHtml?: boolean;
index?: string;
postcssConfig?: string;
scripts?: Array<ExtraEntryPointClass | string>;
styles?: Array<ExtraEntryPointClass | string>;
stylePreprocessorOptions?: {
includePaths?: string[];
sassOptions?: Record<string, any>;
lessOptions?: Record<string, any>;
};
cssModules?: boolean;
ssr?: boolean;
/**
* Use the legacy WriteIndexHtmlPlugin instead of the built-in HtmlRspackPlugin.
*/
useLegacyHtmlPlugin?: boolean;
/**
* Requires useLegacyHtmlPlugin to be false.
* Allows to overwrite the parameters used in the template. When using a function, pass in the original template parameters and use the returned object as the final template parameters.
*/
templateParameters?: Record<string, string> | boolean | ((params: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>);
}
/**
* @deprecated Will be removed in Nx v24. Use `NxAppRspackPlugin` from
* `@nx/rspack/app-plugin` in a standard rspack config and run
* `nx g @nx/rspack:convert-to-inferred`. See
* https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
*/
export declare function withWeb(pluginOptions?: WithWebOptions): (config: Configuration, { options, context }: NxRspackExecutionContext) => Configuration;