copy-webpack-plugin

  • Version 12.0.2
  • Published
  • 78.1 kB
  • 6 dependencies
  • MIT license

Install

npm i copy-webpack-plugin
yarn add copy-webpack-plugin
pnpm add copy-webpack-plugin

Overview

Copy files && directories with webpack

Index

Classes

class CopyPlugin

class CopyPlugin {}
  • {Object} PluginOptions {Pattern[]} patterns {AdditionalOptions} [options]

constructor

constructor(options?: PluginOptions);
  • Parameter options

method apply

apply: (compiler: any) => void;
  • Parameter compiler

Type Aliases

type AdditionalOptions

type AdditionalOptions = {
concurrency?: number | undefined;
};

    type Asset

    type Asset = import('webpack').Asset;

      type CacheFacade

      type CacheFacade = ReturnType<Compilation['getCache']>;

        type Compilation

        type Compilation = import('webpack').Compilation;

          type Compiler

          type Compiler = import('webpack').Compiler;

            type Context

            type Context = string;

              type CopiedResult

              type CopiedResult = {
              sourceFilename: string;
              absoluteFilename: string;
              filename: string;
              source: Asset['source'];
              force: Force | undefined;
              info: Record<string, any>;
              };

                type Etag

                type Etag = ReturnType<ReturnType<Compilation['getCache']>['getLazyHashedEtag']>;

                  type Filter

                  type Filter = (filepath: string) => boolean | Promise<boolean>;

                    type Force

                    type Force = boolean;

                      type From

                      type From = string;

                        type GlobbyOptions

                        type GlobbyOptions = import('globby').Options;

                          type GlobEntry

                          type GlobEntry = import('globby').GlobEntry;

                            type Info

                            type Info =
                            | Record<string, any>
                            | ((item: {
                            absoluteFilename: string;
                            sourceFilename: string;
                            filename: string;
                            toType: ToType;
                            }) => Record<string, any>);

                              type NoErrorOnMissing

                              type NoErrorOnMissing = boolean;

                                type ObjectPattern

                                type ObjectPattern = {
                                from: From;
                                globOptions?: import('globby').Options | undefined;
                                context?: string | undefined;
                                to?: To | undefined;
                                toType?: ToType | undefined;
                                info?: Info | undefined;
                                filter?: Filter | undefined;
                                transform?: Transform | undefined;
                                transformAll?: TransformAllFunction | undefined;
                                force?: boolean | undefined;
                                priority?: number | undefined;
                                noErrorOnMissing?: boolean | undefined;
                                };

                                  type Pattern

                                  type Pattern = StringPattern | ObjectPattern;

                                    type PluginOptions

                                    type PluginOptions = {
                                    patterns: Pattern[];
                                    options?: AdditionalOptions | undefined;
                                    };

                                      type Schema

                                      type Schema = import('schema-utils/declarations/validate').Schema;

                                        type Snapshot

                                        type Snapshot = ReturnType<Compilation['fileSystemInfo']['mergeSnapshots']>;

                                          type StringPattern

                                          type StringPattern = string;

                                            type To

                                            type To = string | ToFunction;

                                              type ToFunction

                                              type ToFunction = (pathData: {
                                              context: string;
                                              absoluteFilename?: string;
                                              }) => string | Promise<string>;

                                                type ToType

                                                type ToType = 'dir' | 'file' | 'template';

                                                  type Transform

                                                  type Transform = TransformerFunction | TransformerObject;

                                                    type TransformAllFunction

                                                    type TransformAllFunction = (
                                                    data: {
                                                    data: Buffer;
                                                    sourceFilename: string;
                                                    absoluteFilename: string;
                                                    }[]
                                                    ) => string | Buffer | Promise<string> | Promise<Buffer>;

                                                      type TransformerCacheObject

                                                      type TransformerCacheObject =
                                                      | {
                                                      keys: {
                                                      [key: string]: any;
                                                      };
                                                      }
                                                      | {
                                                      keys: (
                                                      defaultCacheKeys: {
                                                      [key: string]: any;
                                                      },
                                                      absoluteFilename: string
                                                      ) => Promise<{
                                                      [key: string]: any;
                                                      }>;
                                                      };

                                                        type TransformerFunction

                                                        type TransformerFunction = (
                                                        input: Buffer,
                                                        absoluteFilename: string
                                                        ) => string | Buffer | Promise<string> | Promise<Buffer>;

                                                          type TransformerObject

                                                          type TransformerObject = {
                                                          transformer: TransformerFunction;
                                                          cache?: boolean | TransformerCacheObject | undefined;
                                                          };

                                                            type WebpackError

                                                            type WebpackError = import('webpack').WebpackError;

                                                              type WebpackLogger

                                                              type WebpackLogger = ReturnType<Compilation['getLogger']>;

                                                                Package Files (1)

                                                                Dependencies (6)

                                                                Dev Dependencies (30)

                                                                Peer Dependencies (1)

                                                                Badge

                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/copy-webpack-plugin.

                                                                • Markdown
                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/copy-webpack-plugin)
                                                                • HTML
                                                                  <a href="https://www.jsdocs.io/package/copy-webpack-plugin"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>