mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
[copy-webpack-plugin] Upgrade to v4.4.1 from v4.0.1
This commit is contained in:
@@ -51,6 +51,21 @@ const c: Configuration = {
|
||||
to: 'directory/with/extension.ext',
|
||||
toType: 'dir'
|
||||
},
|
||||
|
||||
// transform and cache (cache is always used with transform option).
|
||||
{
|
||||
from: 'src/*.png',
|
||||
to: 'dest/',
|
||||
transform: (content, path) => content,
|
||||
cache: true
|
||||
},
|
||||
|
||||
// Copy glob results (without dot files) to {output}/to/directory/
|
||||
{
|
||||
from: '**/*.png',
|
||||
fromArgs: { dot: false },
|
||||
to: 'to/directory'
|
||||
},
|
||||
], {
|
||||
ignore: [
|
||||
// Doesn't copy any files with a txt extension
|
||||
|
||||
10
types/copy-webpack-plugin/index.d.ts
vendored
10
types/copy-webpack-plugin/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for copy-webpack-plugin v4.0.0
|
||||
// Type definitions for copy-webpack-plugin v4.4.1
|
||||
// Project: https://github.com/kevlened/copy-webpack-plugin
|
||||
// Definitions by: flying-sheep <https://github.com/flying-sheep>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -10,9 +10,15 @@ interface MiniMatchGlob extends IOptions {
|
||||
glob: string
|
||||
}
|
||||
|
||||
interface MiniMatchOptions extends IOptions {
|
||||
cwd?: string
|
||||
}
|
||||
|
||||
interface CopyPattern {
|
||||
/** File source path or glob */
|
||||
from: string | MiniMatchGlob
|
||||
/** See the `node-glob` options in addition to the ones below. (default: `{ cwd: context }`) */
|
||||
fromArgs?: MiniMatchOptions
|
||||
/**
|
||||
* Path or webpack file-loader patterns. defaults:
|
||||
* output root if `from` is file or dir.
|
||||
@@ -38,6 +44,8 @@ interface CopyPattern {
|
||||
ignore?: Array<string | MiniMatchGlob>
|
||||
/** Function that modifies file contents before writing to webpack. (default: `(content, path) => content`) */
|
||||
transform?: (content: string, path: string) => string
|
||||
/** Enable transform caching. You can use `{ cache: { key: 'my-cache-key' } }` to invalidate the cache. (default: `false`) */
|
||||
cache?: boolean | { key: string }
|
||||
/** Overwrites files already in `compilation.assets` (usually added by other plugins; default: `false`) */
|
||||
force?: boolean
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user