copy-webpack-plugin
- Version 13.0.1
- Published
- 82.4 kB
- 5 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
Type Aliases
- AdditionalOptions
- Asset
- AssetInfo
- CacheFacade
- Compilation
- Compiler
- Context
- CopiedResult
- Etag
- Filter
- Force
- From
- GlobbyOptions
- Info
- InputFileSystem
- NoErrorOnMissing
- ObjectPattern
- Pattern
- PluginOptions
- Schema
- Snapshot
- StringPattern
- To
- ToFunction
- ToType
- Transform
- TransformAllFunction
- TransformerCacheObject
- TransformerFunction
- TransformerObject
- WebpackLogger
Classes
class CopyPlugin
class CopyPlugin {}
constructor
constructor(options?: PluginOptions);
Parameter options
options for the plugin
method apply
apply: (compiler: any) => void;
Parameter compiler
the compiler
Type Aliases
type AdditionalOptions
type AdditionalOptions = { /** * maximum number of concurrent operations, default is 100 */ concurrency?: number | undefined;};
type Asset
type Asset = import('webpack').Asset;
type AssetInfo
type AssetInfo = import('webpack').AssetInfo;
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 = { /** * relative path to the file from the context */ sourceFilename: string; /** * absolute path to the file */ absoluteFilename: string; /** * relative path to the file from the output path */ filename: string; /** * source of the file */ source: Asset['source']; /** * whether to force update the asset if it already exists */ force: Force | undefined; /** * additional information about the asset */ info: Record<string, unknown>;};
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('tinyglobby').GlobOptions;
type Info
type Info = | Record<string, unknown> | ((item: { absoluteFilename: string; sourceFilename: string; filename: string; toType: ToType; }) => Record<string, unknown>);
type InputFileSystem
type InputFileSystem = import('webpack').InputFileSystem;
type NoErrorOnMissing
type NoErrorOnMissing = boolean;
type ObjectPattern
type ObjectPattern = { /** * source path or glob pattern to copy files from */ from: From; /** * options for globbing */ globOptions?: GlobbyOptions | undefined; /** * context for the source path or glob pattern */ context?: Context | undefined; /** * destination path or function to determine the destination path */ to?: To | undefined; /** * type of the destination path, can be "dir", "file" or "template" */ toType?: ToType | undefined; /** * additional information about the asset */ info?: Info | undefined; /** * function to filter files, if it returns false, the file will be skipped */ filter?: Filter | undefined; /** * function to transform the file content, can be a function or an object with a transformer function and cache options */ transform?: Transform | undefined; /** * function to transform all files, it receives an array of objects with data, sourceFilename and absoluteFilename properties */ transformAll?: TransformAllFunction | undefined; /** * whether to force update the asset if it already exists */ force?: Force | undefined; /** * priority of the pattern, patterns with higher priority will be processed first */ priority?: number | undefined; /** * whether to skip errors when no files are found for the pattern */ noErrorOnMissing?: NoErrorOnMissing | undefined;};
type Pattern
type Pattern = StringPattern | ObjectPattern;
type PluginOptions
type PluginOptions = { /** * array of patterns to copy files from */ patterns: Pattern[]; /** * additional options for the plugin */ 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]: unknown; }; } | { keys: ( defaultCacheKeys: { [key: string]: unknown; }, absoluteFilename: string ) => Promise<{ [key: string]: unknown; }>; };
type TransformerFunction
type TransformerFunction = ( input: Buffer, absoluteFilename: string) => string | Buffer | Promise<string> | Promise<Buffer>;
type TransformerObject
type TransformerObject = { /** * function to transform the file content */ transformer: TransformerFunction; /** * whether to cache the transformed content or an object with keys for caching */ cache?: (boolean | TransformerCacheObject) | undefined;};
type WebpackLogger
type WebpackLogger = ReturnType<Compilation['getLogger']>;
Package Files (1)
Dependencies (5)
Dev Dependencies (40)
- @babel/cli
- @babel/core
- @babel/eslint-parser
- @babel/preset-env
- @commitlint/cli
- @commitlint/config-conventional
- @eslint/js
- @eslint/markdown
- @stylistic/eslint-plugin
- @types/glob-parent
- @types/node
- @types/normalize-path
- @types/serialize-javascript
- babel-jest
- cross-env
- cspell
- del
- del-cli
- eslint
- eslint-config-prettier
- eslint-config-webpack
- eslint-plugin-import
- eslint-plugin-jest
- eslint-plugin-jsdoc
- eslint-plugin-n
- eslint-plugin-prettier
- eslint-plugin-unicorn
- file-loader
- globals
- husky
- is-gzip
- jest
- lint-staged
- memfs
- npm-run-all
- prettier
- standard-version
- typescript
- typescript-eslint
- webpack
Peer Dependencies (1)
Badge
To add a badge like this oneto 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[](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>
- Updated .
Package analyzed in 3717 ms. - Missing or incorrect documentation? Open an issue for this package.