import type { AsyncParallelHook } from 'tapable'; import type { AsyncSeriesBailHook } from 'tapable'; import type { AsyncSeriesHook } from 'tapable'; import type { AsyncSeriesWaterfallHook } from 'tapable'; import type { Configuration } from 'webpack-dev-server'; import type { HeftConfiguration } from '@rushstack/heft'; import type { IHeftTaskSession } from '@rushstack/heft'; import type * as TWebpack from 'webpack'; /** * @public */ export declare type IWebpackConfiguration = IWebpackConfigurationWithDevServer | IWebpackConfigurationWithDevServer[]; /** * The environment passed into the Webpack configuration function. Loosely based * on the default Webpack environment options, specified here: * https://webpack.js.org/api/cli/#environment-options * * @public */ export declare interface IWebpackConfigurationFnEnvironment { /** * Whether or not the run is in production mode. Synonym of * {@link IWebpackConfigurationFnEnvironment.production}. */ prod: boolean; /** * Whether or not the run is in production mode. Synonym of * {@link IWebpackConfigurationFnEnvironment.prod}. */ production: boolean; /** * The task session provided to the plugin. */ taskSession: IHeftTaskSession; /** * The Heft configuration provided to the plugin. */ heftConfiguration: HeftConfiguration; /** * The resolved Webpack package. */ webpack: typeof TWebpack; } /** * @public */ export declare interface IWebpackConfigurationWithDevServer extends TWebpack.Configuration { devServer?: Configuration; } /** * @public */ export declare interface IWebpackPluginAccessor { /** * Hooks that are called at various points in the Webpack plugin lifecycle. */ readonly hooks: IWebpackPluginAccessorHooks; /** * Parameters that are provided by the Webpack plugin. */ readonly parameters: IWebpackPluginAccessorParameters; } /** * @public */ export declare interface IWebpackPluginAccessorHooks { /** * A hook that allows for loading custom configurations used by the Webpack * plugin. If a tap returns a value other than `undefined` before stage {@link STAGE_LOAD_LOCAL_CONFIG}, * it will suppress loading from the webpack config file. To provide a fallback behavior in the * absence of a local config file, tap this hook with a `stage` value greater than {@link STAGE_LOAD_LOCAL_CONFIG}. * * @remarks * Tapable event handlers can return `false` instead of `undefined` to suppress * other handlers from creating a configuration object, and prevent webpack from running. */ readonly onLoadConfiguration: AsyncSeriesBailHook; /** * A hook that allows for modification of the loaded configuration used by the Webpack * plugin. If no configuration was loaded, this hook will not be called. */ readonly onConfigure: AsyncSeriesHook; /** * A hook that provides the finalized configuration that will be used by Webpack. * If no configuration was loaded, this hook will not be called. */ readonly onAfterConfigure: AsyncParallelHook; /** * A hook that provides the stats output from Webpack. If no configuration is loaded, * this hook will not be called. */ readonly onEmitStats: AsyncParallelHook; /** * A hook that allows for customization of the file watcher options. If not running in watch mode, this hook will not be called. */ readonly onGetWatchOptions: AsyncSeriesWaterfallHook[0], Readonly, never>; } /** * @public */ export declare interface IWebpackPluginAccessorParameters { /** * Whether or not serve mode was enabled by passing the `--serve` flag. */ readonly isServeMode: boolean; } /** * @public */ export declare const PluginName: 'webpack5-plugin'; /** * The stage in the `onLoadConfiguration` hook at which the config will be loaded from the local * webpack config file. * @public */ export declare const STAGE_LOAD_LOCAL_CONFIG: 1000; export { }