@types/webpack-react-component-name
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

Installation

npm install --save @types/webpack-react-component-name

Summary

This package contains type definitions for webpack-react-component-name (https://github.com/runreflect/webpack-react-component-name#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-react-component-name.

import { Compiler, WebpackPluginInstance } from "webpack";

declare namespace WebpackReactComponentNamePlugin {
    /**
     * If the item is a string, it will use standard glob syntax. If the item is a Regular Expression, the path will be tested against it.
     * If the item is a function, the path will be passed into it for testing.
     */
    type PathMatch = string | RegExp | ((path: string) => boolean);

    interface Options {
        /**
         * If set true, the plugin will name the components exported from node_modules
         * @defaultValue false
         */
        parseDependencies?: boolean;

        /**
         * If the path matches any of the elements in this array, it will be included if it isn't explicitly excluded
         * @defaultValue []
         */
        include?: readonly PathMatch[];

        /**
         * If the path matches any of the elements in this array, it will be excluded
         * @defaultValue []
         */
        exclude?: readonly PathMatch[];
    }
}

/** Normally React component names are minified during compilation. This plugin makes these component names available through the `displayName` property in production bundles */
declare class WebpackReactComponentNamePlugin implements WebpackPluginInstance {
    constructor(options?: WebpackReactComponentNamePlugin.Options);

    /**
     * The run point of the plugin, required method.
     */
    apply: (compiler: Compiler) => void;
}

export = WebpackReactComponentNamePlugin;

Additional Details

  • Last updated: Wed, 19 Jun 2024 20:35:47 GMT
  • Dependencies: webpack

Credits

These definitions were written by Dorian Latchague.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/webpack-react-component-name

Weekly Downloads

315

Version

5.0.0

License

MIT

Unpacked Size

5.81 kB

Total Files

5

Last publish

Collaborators

  • types