 \href{https://github.com/webpack/webpack}{\texttt{  }} 

\href{https://npmjs.com/package/copy-webpack-plugin}{\texttt{ }} \href{https://nodejs.org}{\texttt{ }} \href{https://david-dm.org/webpack-contrib/copy-webpack-plugin}{\texttt{ }} \href{https://github.com/webpack-contrib/copy-webpack-plugin/actions}{\texttt{ }} \href{https://codecov.io/gh/webpack-contrib/copy-webpack-plugin}{\texttt{ }} \href{https://gitter.im/webpack/webpack}{\texttt{ }} \href{https://packagephobia.now.sh/result?p=copy-webpack-plugin}{\texttt{ }}\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6697}{}\doxysection{copy-\/webpack-\/plugin}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6697}
Copies individual files or entire directories, which already exist, to the build directory.\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6698}{}\doxysubsection{Getting Started}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6698}
To begin, you\textquotesingle{}ll need to install {\ttfamily copy-\/webpack-\/plugin}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install copy-\/webpack-\/plugin -\/-\/save-\/dev }

\end{DoxyCode}


Then add the plugin to your {\ttfamily webpack} config. For example\+:

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{const CopyPlugin = require('copy-\/webpack-\/plugin');}
\DoxyCodeLine{}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{ from: 'source', to: 'dest' \},}
\DoxyCodeLine{        \{ from: 'other', to: 'public' \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


\begin{quote}
ℹ️ {\ttfamily webpack-\/copy-\/plugin} is not designed to copy files generated from the build process; rather, it is to copy files that already exist in the source tree, as part of the build process. \end{quote}
\begin{quote}
ℹ️ If you want {\ttfamily webpack-\/dev-\/server} to write files to the output directory during development, you can force it with the \href{https://github.com/webpack/webpack-dev-middleware\#writetodisk}{\texttt{ {\ttfamily write\+To\+Disk}}} option or the \href{https://github.com/gajus/write-file-webpack-plugin}{\texttt{ {\ttfamily write-\/file-\/webpack-\/plugin}}}. \end{quote}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6699}{}\doxysubsection{Options}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6699}
The plugin\textquotesingle{}s signature\+:

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{const CopyPlugin = require('copy-\/webpack-\/plugin');}
\DoxyCodeLine{}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{ from: 'source', to: 'dest' \},}
\DoxyCodeLine{        \{ from: 'other', to: 'public' \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{      options: \{}
\DoxyCodeLine{        concurrency: 100,}
\DoxyCodeLine{      \},}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6700}{}\doxysubsubsection{Patterns}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6700}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{5}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Name   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default   }&\cellcolor{\tableheadbgcolor}\textbf{ Description    }\\\cline{1-5}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Name   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default   }&\cellcolor{\tableheadbgcolor}\textbf{ Description    }\\\cline{1-5}
\endhead
\PBS\centering \href{\#from}{\texttt{ {\ttfamily from}}}   &\PBS\centering {\ttfamily \{String\}}   &\PBS\centering {\ttfamily undefined}   &Glob or path from where we сopy files.    \\\cline{1-5}
\PBS\centering \href{\#to}{\texttt{ {\ttfamily to}}}   &\PBS\centering {\ttfamily \{String\}}   &\PBS\centering {\ttfamily compiler.\+options.\+output}   &Output path.    \\\cline{1-5}
\PBS\centering \href{\#context}{\texttt{ {\ttfamily context}}}   &\PBS\centering {\ttfamily \{String\}}   &\PBS\centering {\ttfamily options.\+context \textbackslash{}$\vert$\textbackslash{}$\vert$ compiler.\+options.\+context}   &A path that determines how to interpret the {\ttfamily from} path.    \\\cline{1-5}
\PBS\centering \href{\#globoptions}{\texttt{ {\ttfamily glob\+Options}}}   &\PBS\centering {\ttfamily \{Object\}}   &\PBS\centering {\ttfamily undefined}   &\href{https://github.com/sindresorhus/globby\#options}{\texttt{ Options}} passed to the glob pattern matching library including {\ttfamily ignore} option.    \\\cline{1-5}
\PBS\centering \href{\#totype}{\texttt{ {\ttfamily to\+Type}}}   &\PBS\centering {\ttfamily \{String\}}   &\PBS\centering {\ttfamily undefined}   &Determinate what is {\ttfamily to} option -\/ directory, file or template.    \\\cline{1-5}
\PBS\centering \href{\#force}{\texttt{ {\ttfamily force}}}   &\PBS\centering {\ttfamily \{Boolean\}}   &\PBS\centering {\ttfamily false}   &Overwrites files already in {\ttfamily compilation.\+assets} (usually added by other plugins/loaders).    \\\cline{1-5}
\PBS\centering \href{\#flatten}{\texttt{ {\ttfamily flatten}}}   &\PBS\centering {\ttfamily \{Boolean\}}   &\PBS\centering {\ttfamily false}   &Removes all directory references and only copies file names.    \\\cline{1-5}
\PBS\centering \href{\#transform}{\texttt{ {\ttfamily transform}}}   &\PBS\centering {\ttfamily \{Function\}}   &\PBS\centering {\ttfamily undefined}   &Allows to modify the file contents.    \\\cline{1-5}
\PBS\centering \href{\#cacheTransform}{\texttt{ {\ttfamily cache\+Transform}}}   &\PBS\centering {\ttfamily \{Boolean\textbackslash{}$\vert$\+String\textbackslash{}$\vert$\+Object\}}   &\PBS\centering {\ttfamily false}   &Enable {\ttfamily transform} caching. You can use `\{ cache\+: \{ key\+: \textquotesingle{}my-\/cache-\/key' \} \}{\ttfamily to invalidate the cache. \textbackslash{}ilinebr $<$/td$>$ $<$/tr$>$ $<$tr class=\char`\"{}markdown\+Table\+Row\+Even\char`\"{}$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$ \mbox{[}}transform\+Path{\ttfamily \mbox{]}(\#transformpath) \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}\{Function\}{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}undefined{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Left\char`\"{}$>$ Allows to modify the writing path. \textbackslash{}ilinebr $<$/td$>$ $<$/tr$>$ $<$tr class=\char`\"{}markdown\+Table\+Row\+Odd\char`\"{}$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$ \mbox{[}}no\+Error\+On\+Missing{\ttfamily \mbox{]}(\#noerroronmissing) \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}\{Boolean\}{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}false\`{}   &Doesn\textquotesingle{}t generate an error on missing file(s).   \\\cline{1-5}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6701}{}\doxyparagraph{$<$tt$>$from$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6701}
Type\+: {\ttfamily String} Default\+: {\ttfamily undefined}

Glob or path from where we сopy files. Globs accept \href{https://github.com/mrmlnc/fast-glob\#pattern-syntax}{\texttt{ fast-\/glob pattern-\/syntax}}. Glob can only be a {\ttfamily string}.

\begin{quote}
⚠️ Don\textquotesingle{}t use directly {\ttfamily \textbackslash{}\textbackslash{}} in {\ttfamily from} option if it is a {\ttfamily glob} (i.\+e {\ttfamily path\textbackslash{}to\textbackslash{}file.\+ext}) option because on UNIX the backslash is a valid character inside a path component, i.\+e., it\textquotesingle{}s not a separator. On Windows, the forward slash and the backward slash are both separators. Instead please use {\ttfamily /}. \end{quote}
{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        'relative/path/to/file.ext',}
\DoxyCodeLine{        'relative/path/to/dir',}
\DoxyCodeLine{        path.resolve(\_\_dirname, 'src', 'file.ext'),}
\DoxyCodeLine{        path.resolve(\_\_dirname, 'src', 'dir'),}
\DoxyCodeLine{        '**/*',}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: '**/*',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{        // If absolute path is a `glob` we replace backslashes with forward slashes, because only forward slashes can be used in the `glob`}
\DoxyCodeLine{        path.posix.join(}
\DoxyCodeLine{          path.resolve(\_\_dirname, 'src').replace(/\(\backslash\)\(\backslash\)/g, '/'),}
\DoxyCodeLine{          '*.txt'}
\DoxyCodeLine{        ),}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6702}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6702}%
\doxysubparagraph*{{\ttfamily For windows}}

If you define {\ttfamily from} as absolute file path or absolute folder path on {\ttfamily Windows}, you can use windows path segment ({\ttfamily \textbackslash{}\textbackslash{}})


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: path.resolve(\_\_dirname, 'file.txt'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


But you should always use forward-\/slashes in {\ttfamily glob} expressions See \href{https://github.com/mrmlnc/fast-glob\#how-to-write-patterns-on-windows}{\texttt{ fast-\/glob manual}}.


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          // If absolute path is a `glob` we replace backslashes with forward slashes, because only forward slashes can be used in the `glob`}
\DoxyCodeLine{          from: path.posix.join(}
\DoxyCodeLine{            path.resolve(\_\_dirname, 'fixtures').replace(/\(\backslash\)\(\backslash\)/g, '/'),}
\DoxyCodeLine{            '*.txt'}
\DoxyCodeLine{          ),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


The {\ttfamily context} behaves differently depending on what the {\ttfamily from} is ({\ttfamily glob}, {\ttfamily file} or {\ttfamily dir}). More \href{\#examples}{\texttt{ {\ttfamily examples}}}\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6703}{}\doxyparagraph{$<$tt$>$to$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6703}
Type\+: {\ttfamily String} Default\+: {\ttfamily compiler.\+options.\+output}

Output path.

\begin{quote}
⚠️ Don\textquotesingle{}t use directly {\ttfamily \textbackslash{}\textbackslash{}} in {\ttfamily to} (i.\+e {\ttfamily path\textbackslash{}to\textbackslash{}dest}) option because on UNIX the backslash is a valid character inside a path component, i.\+e., it\textquotesingle{}s not a separator. On Windows, the forward slash and the backward slash are both separators. Instead please use {\ttfamily /} or {\ttfamily path} methods. \end{quote}
{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: '**/*',}
\DoxyCodeLine{          to: 'relative/path/to/dest/',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: '**/*',}
\DoxyCodeLine{          to: '/absolute/path/to/dest/',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: '**/*',}
\DoxyCodeLine{          to: '[path][name].[contenthash].[ext]',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6704}{}\doxyparagraph{$<$tt$>$context$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6704}
Type\+: {\ttfamily String} Default\+: {\ttfamily options.\+context$\vert$compiler.options.\+context}

A path that determines how to interpret the {\ttfamily from} path.

\begin{quote}
⚠️ Don\textquotesingle{}t use directly {\ttfamily \textbackslash{}\textbackslash{}} in {\ttfamily context} (i.\+e {\ttfamily path\textbackslash{}to\textbackslash{}context}) option because on UNIX the backslash is a valid character inside a path component, i.\+e., it\textquotesingle{}s not a separator. On Windows, the forward slash and the backward slash are both separators. Instead please use {\ttfamily /} or {\ttfamily path} methods. \end{quote}
{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.txt',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          context: 'app/',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


The {\ttfamily context} option can be an absolute or relative path. If {\ttfamily context} is a relative, then it is converted to absolute based to {\ttfamily compiler.\+options.\+context}

Also, {\ttfamily context} indicates how to interpret the search results. Further, he is considered in this role.

To determine the structure from which the found resources will be copied to the destination folder, the {\ttfamily context} option is used.

If {\ttfamily from} is a file, then {\ttfamily context} is equal to the directory in which this file is located. Accordingly, the result will be only the file name.

If {\ttfamily from} is a directory, then {\ttfamily context} is the same as {\ttfamily from} and is equal to the directory itself. In this case, the result will be a hierarchical structure of the found folders and files relative to the specified directory.

If {\ttfamily from} is a glob, then regardless of the {\ttfamily context} option, the result will be the structure specified in the {\ttfamily from} option

More \href{\#examples}{\texttt{ {\ttfamily examples}}}\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6705}{}\doxyparagraph{$<$tt$>$glob\+Options$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6705}
Type\+: {\ttfamily Object} Default\+: {\ttfamily undefined}

Allows to configute the glob pattern matching library used by the plugin. \href{https://github.com/sindresorhus/globby\#options}{\texttt{ See the list of supported options}} To exclude files from the selection, you should use \href{https://github.com/mrmlnc/fast-glob\#ignore}{\texttt{ glob\+Options.\+ignore option}}

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'public/**/*',}
\DoxyCodeLine{          globOptions: \{}
\DoxyCodeLine{            dot: true,}
\DoxyCodeLine{            gitignore: true,}
\DoxyCodeLine{            ignore: ['**/file.*', '**/ignored-\/directory/**'],}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6706}{}\doxyparagraph{$<$tt$>$to\+Type$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6706}
Type\+: {\ttfamily String} Default\+: {\ttfamily undefined}

Determinate what is {\ttfamily to} option -\/ directory, file or template. Sometimes it is hard to say what is {\ttfamily to}, example {\ttfamily path/to/dir-\/with.\+ext}. If you want to copy files in directory you need use {\ttfamily dir} option. We try to automatically determine the {\ttfamily type} so you most likely do not need this option.

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{4}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Name   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default   }&\cellcolor{\tableheadbgcolor}\textbf{ Description    }\\\cline{1-4}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Name   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default   }&\cellcolor{\tableheadbgcolor}\textbf{ Description    }\\\cline{1-4}
\endhead
\PBS\centering $\ast$$\ast$`\textquotesingle{}dir'{\ttfamily $\ast$$\ast$ \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}\{String\}{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}undefined{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Left\char`\"{}$>$ If}to{\ttfamily has no extension or ends on}\textquotesingle{}/\textquotesingle{}{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$/tr$>$ $<$tr class=\char`\"{}markdown\+Table\+Row\+Even\char`\"{}$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$ $\ast$$\ast$}\textquotesingle{}file\textquotesingle{}{\ttfamily $\ast$$\ast$ \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}\{String\}{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}undefined{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Left\char`\"{}$>$ If}to{\ttfamily is not a directory and is not a template \textbackslash{}ilinebr $<$/td$>$ $<$/tr$>$ $<$tr class=\char`\"{}markdown\+Table\+Row\+Odd\char`\"{}$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$ $\ast$$\ast$}\textquotesingle{}template\textquotesingle{}{\ttfamily $\ast$$\ast$ \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}\{String\}{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Center\char`\"{}$>$}undefined{\ttfamily \textbackslash{}ilinebr $<$/td$>$ $<$td class=\char`\"{}markdown\+Table\+Body\+Left\char`\"{}$>$ If}to\`{} contains \href{https://github.com/webpack-contrib/file-loader\#placeholders}{\texttt{ a template pattern}}   \\\cline{1-4}
\end{longtabu}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6707}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6707}%
\doxysubparagraph*{`\textquotesingle{}dir'\`{}}

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'path/to/file.txt',}
\DoxyCodeLine{          to: 'directory/with/extension.ext',}
\DoxyCodeLine{          toType: 'dir',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6708}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6708}%
\doxysubparagraph*{`\textquotesingle{}file'\`{}}

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'path/to/file.txt',}
\DoxyCodeLine{          to: 'file/without/extension',}
\DoxyCodeLine{          toType: 'file',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6709}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6709}%
\doxysubparagraph*{`\textquotesingle{}template'\`{}}

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/',}
\DoxyCodeLine{          to: 'dest/[name].[hash].[ext]',}
\DoxyCodeLine{          toType: 'template',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6710}{}\doxyparagraph{$<$tt$>$force$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6710}
Type\+: {\ttfamily Boolean} Default\+: {\ttfamily false}

Overwrites files already in {\ttfamily compilation.\+assets} (usually added by other plugins/loaders).

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/**/*',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          force: true,}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6711}{}\doxyparagraph{$<$tt$>$flatten$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6711}
Type\+: {\ttfamily Boolean} Default\+: {\ttfamily false}

Removes all directory references and only copies file names.

\begin{quote}
⚠️ If files have the same name, the result is non-\/deterministic. \end{quote}
{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/**/*',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          flatten: true,}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6712}{}\doxyparagraph{$<$tt$>$transform$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6712}
Type\+: {\ttfamily Function} Default\+: {\ttfamily undefined}

Allows to modify the file contents.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          // The `content` argument is a [`Buffer`](https://nodejs.org/api/buffer.html) object, it could be converted to a `String` to be processed using `content.toString()`}
\DoxyCodeLine{          // The `absoluteFrom` argument is a `String`, it is absolute path from where the file is being copied}
\DoxyCodeLine{          transform(content, absoluteFrom) \{}
\DoxyCodeLine{            return optimize(content);}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transform(content, path) \{}
\DoxyCodeLine{            return Promise.resolve(optimize(content));}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6713}{}\doxyparagraph{$<$tt$>$cache\+Transform$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6713}
Type\+: {\ttfamily Boolean$\vert$\+String$\vert$\+Object} Default\+: {\ttfamily false}

Enable/disable and configure caching. Default path to cache directory\+: {\ttfamily node\+\_\+modules/.cache/copy-\/webpack-\/plugin}.

\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6714}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6714}%
\doxysubparagraph*{{\ttfamily Boolean}}

Enables/\+Disable {\ttfamily transform} caching.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transform(content, path) \{}
\DoxyCodeLine{            return optimize(content);}
\DoxyCodeLine{          \},}
\DoxyCodeLine{          cacheTransform: true,}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6715}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6715}%
\doxysubparagraph*{{\ttfamily String}}

Enables {\ttfamily transform} caching and setup cache directory.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transform(content, path) \{}
\DoxyCodeLine{            return optimize(content);}
\DoxyCodeLine{          \},}
\DoxyCodeLine{          // Should be absolute}
\DoxyCodeLine{          cacheTransform: path.resolve(\_\_dirname, 'cache-\/directory'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6716}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6716}%
\doxysubparagraph*{{\ttfamily Object}}

Enables {\ttfamily transform} caching and setup cache directory and invalidation keys.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transform(content, path) \{}
\DoxyCodeLine{            return optimize(content);}
\DoxyCodeLine{          \},}
\DoxyCodeLine{          cacheTransform: \{}
\DoxyCodeLine{            directory: path.resolve(\_\_dirname, 'cache-\/directory'),}
\DoxyCodeLine{            keys: \{}
\DoxyCodeLine{              // May be useful for invalidating cache based on external values}
\DoxyCodeLine{              // For example, you can invalid cache based on `process.version` -\/ \{ node: process.version \}}
\DoxyCodeLine{              key: 'value',}
\DoxyCodeLine{            \},}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


You can setup invalidation keys using a function.

Simple function\+:

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transform(content, path) \{}
\DoxyCodeLine{            return optimize(content);}
\DoxyCodeLine{          \},}
\DoxyCodeLine{          cacheTransform: \{}
\DoxyCodeLine{            directory: path.resolve(\_\_dirname, 'cache-\/directory'),}
\DoxyCodeLine{            keys: (defaultCacheKeys, absoluteFrom) => \{}
\DoxyCodeLine{              const keys = getCustomCacheInvalidationKeysSync();}
\DoxyCodeLine{}
\DoxyCodeLine{              return \{}
\DoxyCodeLine{                ...defaultCacheKeys,}
\DoxyCodeLine{                keys,}
\DoxyCodeLine{              \};}
\DoxyCodeLine{            \},}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Async function\+:

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transform(content, path) \{}
\DoxyCodeLine{            return optimize(content);}
\DoxyCodeLine{          \},}
\DoxyCodeLine{          cacheTransform: \{}
\DoxyCodeLine{            directory: path.resolve(\_\_dirname, 'cache-\/directory'),}
\DoxyCodeLine{            keys: async (defaultCacheKeys, absoluteFrom) => \{}
\DoxyCodeLine{              const keys = await getCustomCacheInvalidationKeysAsync();}
\DoxyCodeLine{}
\DoxyCodeLine{              return \{}
\DoxyCodeLine{                ...defaultCacheKeys,}
\DoxyCodeLine{                keys,}
\DoxyCodeLine{              \};}
\DoxyCodeLine{            \},}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6717}{}\doxyparagraph{$<$tt$>$transform\+Path$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6717}
Type\+: {\ttfamily Function} Default\+: {\ttfamily undefined}

Allows to modify the writing path.

\begin{quote}
⚠️ Don\textquotesingle{}t return directly {\ttfamily \textbackslash{}\textbackslash{}} in {\ttfamily transform\+Path} (i.\+e {\ttfamily path\textbackslash{}to\textbackslash{}new\+File}) option because on UNIX the backslash is a valid character inside a path component, i.\+e., it\textquotesingle{}s not a separator. On Windows, the forward slash and the backward slash are both separators. Instead please use {\ttfamily /} or {\ttfamily path} methods. \end{quote}
{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transformPath(targetPath, absolutePath) \{}
\DoxyCodeLine{            return 'newPath';}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/*.png',}
\DoxyCodeLine{          to: 'dest/',}
\DoxyCodeLine{          transformPath(targetPath, absolutePath) \{}
\DoxyCodeLine{            return Promise.resolve('newPath');}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6718}{}\doxysubsubsection{$<$tt$>$no\+Error\+On\+Missing$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6718}
Type\+: {\ttfamily Boolean} Default\+: {\ttfamily false}

Doesn\textquotesingle{}t generate an error on missing file(s);


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: path.resolve(\_\_dirname, 'missing-\/file.txt'),}
\DoxyCodeLine{          noErrorOnMissing: true,}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6719}{}\doxysubsubsection{Options}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6719}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{4}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Name   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default   }&\cellcolor{\tableheadbgcolor}\textbf{ Description    }\\\cline{1-4}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Name   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default   }&\cellcolor{\tableheadbgcolor}\textbf{ Description    }\\\cline{1-4}
\endhead
\PBS\centering \href{\#concurrency}{\texttt{ {\ttfamily concurrency}}}   &\PBS\centering {\ttfamily \{Number\}}   &\PBS\centering {\ttfamily 100}   &Limits the number of simultaneous requests to fs   \\\cline{1-4}
\end{longtabu}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6720}{}\doxyparagraph{$<$tt$>$concurrency$<$/tt$>$}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6720}
limits the number of simultaneous requests to fs

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [...patterns],}
\DoxyCodeLine{      options: \{ concurrency: 50 \},}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6721}{}\doxysubsubsection{Examples}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6721}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6722}{}\doxyparagraph{Different variants $<$tt$>$from$<$/tt$>$ ($<$tt$>$glob$<$/tt$>$, $<$tt$>$file$<$/tt$>$ or $<$tt$>$dir$<$/tt$>$).}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6722}
Take for example the following file structure\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{src/directory-\/nested/deep-\/nested/deepnested-\/file.txt}
\DoxyCodeLine{src/directory-\/nested/nested-\/file.txt }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6723}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6723}%
\doxysubparagraph*{From is a Glob}

Everything that you specify in {\ttfamily from} will be included in the result\+:

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'src/directory-\/nested/**/*',}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Result\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{src/directory-\/nested/deep-\/nested/deepnested-\/file.txt,}
\DoxyCodeLine{src/directory-\/nested/nested-\/file.txt }

\end{DoxyCode}


If you want only content {\ttfamily src/directory-\/nested/}, you should only indicate {\ttfamily glob} in {\ttfamily from}. The path to the folder in which the search should take place, should be moved to {\ttfamily context}.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: '**/*',}
\DoxyCodeLine{          context: path.resolve(\_\_dirname, 'src', 'directory-\/nested'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Result\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{deep-\/nested/deepnested-\/file.txt,}
\DoxyCodeLine{nested-\/file.txt }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6724}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6724}%
\doxysubparagraph*{From is a Dir}

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: path.resolve(\_\_dirname, 'src', 'directory-\/nested'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Result\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{deep-\/nested/deepnested-\/file.txt,}
\DoxyCodeLine{nested-\/file.txt }

\end{DoxyCode}


Technically, this is {\ttfamily $\ast$$\ast$/$\ast$} with a predefined context equal to the specified directory.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: '**/*',}
\DoxyCodeLine{          context: path.resolve(\_\_dirname, 'src', 'directory-\/nested'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Result\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{deep-\/nested/deepnested-\/file.txt,}
\DoxyCodeLine{nested-\/file.txt }

\end{DoxyCode}


\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6725}%
\Hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6725}%
\doxysubparagraph*{From is a File}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: path.resolve(}
\DoxyCodeLine{            \_\_dirname,}
\DoxyCodeLine{            'src',}
\DoxyCodeLine{            'directory-\/nested',}
\DoxyCodeLine{            'nested-\/file.txt'}
\DoxyCodeLine{          ),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Result\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{nested-\/file.txt }

\end{DoxyCode}


Technically, this is a filename with a predefined context equal to {\ttfamily path.\+dirname(path\+To\+File)}.

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: 'nested-\/file.txt',}
\DoxyCodeLine{          context: path.resolve(\_\_dirname, 'src', 'directory-\/nested'),}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}


Result\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{nested-\/file.txt }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6726}{}\doxyparagraph{Ignoring files}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6726}
{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  plugins: [}
\DoxyCodeLine{    new CopyPlugin(\{}
\DoxyCodeLine{      patterns: [}
\DoxyCodeLine{        \{}
\DoxyCodeLine{          from: path.posix.join(}
\DoxyCodeLine{            path.resolve(\_\_dirname, 'src').replace(/\(\backslash\)\(\backslash\)/g, '/'),}
\DoxyCodeLine{            '**/*'}
\DoxyCodeLine{          ),}
\DoxyCodeLine{          globOptions: \{}
\DoxyCodeLine{            ignore: [}
\DoxyCodeLine{              // Ignore all `txt` files}
\DoxyCodeLine{              '**/*.txt',}
\DoxyCodeLine{              // Ignore all files in all subdirectories}
\DoxyCodeLine{              '**/subdir/**',}
\DoxyCodeLine{            ],}
\DoxyCodeLine{          \},}
\DoxyCodeLine{        \},}
\DoxyCodeLine{      ],}
\DoxyCodeLine{    \}),}
\DoxyCodeLine{  ],}
\DoxyCodeLine{\}; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6727}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6727}
Please take a moment to read our contributing guidelines if you haven\textquotesingle{}t yet done so.

./.github/\+CONTRIBUTING.\+md \char`\"{}\+CONTRIBUTING\char`\"{}\hypertarget{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6728}{}\doxysubsection{License}\label{md_sfcode_node_modules_copy_webpack_plugin_README_autotoc_md6728}
\href{./LICENSE}{\texttt{ MIT}} 