From e75508c06c52a21526de2770aaa786e283250cae Mon Sep 17 00:00:00 2001 From: Derek Sifford Date: Sun, 14 Apr 2019 20:07:47 -0400 Subject: [PATCH] [copy-webpack-plugin] fix transform parameter the `content` parameter of `transform` is a `Buffer`, not a `string`. --- types/copy-webpack-plugin/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/copy-webpack-plugin/index.d.ts b/types/copy-webpack-plugin/index.d.ts index bc0fc5066a..46d35af756 100644 --- a/types/copy-webpack-plugin/index.d.ts +++ b/types/copy-webpack-plugin/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +/// + import { Plugin } from 'webpack' import { IOptions } from 'minimatch' @@ -44,7 +46,7 @@ interface CopyPattern { /** Additional globs to ignore for this pattern. (default: `[]`) */ ignore?: Array /** Function that modifies file contents before writing to webpack. (default: `(content, path) => content`) */ - transform?: (content: string, path: string) => string + transform?: (content: Buffer, 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`) */