UNPKG

@codecov/nextjs-webpack-plugin

Version:

Official Codecov NextJS (Webpack) plugin

39 lines (36 loc) 1.11 kB
import * as webpack from 'webpack'; import { WebpackPluginInstance } from 'unplugin'; import { Options } from '@codecov/bundler-plugin-core'; interface NextPluginOptions extends Options { webpack: typeof webpack | null; } /** * Details for the Codecov NextJS (Webpack) plugin. * * @example * ```typescript * // next.config.mjs * import { codecovNextJSWebpackPlugin } from "@codecov/nextjs-webpack-plugin"; * * export default { * webpack: (config, options) => { * config.plugins.push( * codecovNextJSWebpackPlugin({ * enableBundleAnalysis: true, * bundleName: "example-nextjs-webpack-bundle", * uploadToken: process.env.CODECOV_TOKEN, * webpack: options.webpack, * }), * ); * * return config; * }, * }; * ``` * * @param options.webpack - pass in the webpack instance from the NextJS configuration. * * @see {@link @codecov/bundler-plugin-core!Options | Options} for list of options. */ declare const codecovNextJSWebpackPlugin: (options: NextPluginOptions) => WebpackPluginInstance; export { codecovNextJSWebpackPlugin };