Skip to content

Commit 8b14cfa

Browse files
committed
Updated docs
1 parent f8ed94d commit 8b14cfa

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ A pattern looks like:
2222
- is required
2323
- can be an absolute or path relative to the context
2424
- can be a file or directory
25+
- can be a glob
2526
* `to`
2627
- is optional
27-
- is relative to the build root (webpack defaults to `dist`)
28-
- defaults to `'/'`
28+
- if not absolute, it's relative to the build root
2929
- must be a directory if `from` is a directory
3030
* `toType`
3131
- is optional
@@ -54,19 +54,22 @@ module.exports = {
5454
plugins: [
5555
new CopyWebpackPlugin([
5656
// {output}/file.txt
57-
{ from: 'path/to/file.txt' },
57+
{ from: 'from/file.txt' },
5858

59-
// {output}/path/to/build/file.txt
60-
{ from: 'path/to/file.txt', to: 'path/to/build/file.txt' },
59+
// {output}/to/file.txt
60+
{ from: 'from/file.txt', to: 'to/file.txt' },
6161

62-
// {output}/path/to/build/directory/file.txt
63-
{ from: 'path/to/file.txt', to: 'path/to/build/directory' },
62+
// {output}/to/directory/file.txt
63+
{ from: 'from/file.txt', to: 'to/directory' },
6464

6565
// Copy directory contents to {output}/
66-
{ from: 'path/to/directory' },
66+
{ from: 'from/directory' },
6767

68-
// Copy directory contents to {output}/path/to/build/directory/
69-
{ from: 'path/to/directory', to: 'path/to/build/directory' },
68+
// Copy directory contents to {output}/to/directory/
69+
{ from: 'from/directory', to: 'to/directory' },
70+
71+
// Copy glob results to /absolute/path/
72+
{ from: 'from/directory/**/*', to: '/absolute/path' },
7073

7174
// {output}/file/without/extension
7275
{

0 commit comments

Comments
 (0)