Skip to content

Commit

Permalink
chore: update globby
Browse files Browse the repository at this point in the history
BRAKING CHANGE: globby was update to latest version, some pattern can't work on windows, please read documentation
  • Loading branch information
cap-Bernardito committed Apr 30, 2020
1 parent 64b2e1a commit a728675
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 228 deletions.
23 changes: 22 additions & 1 deletion README.md
Expand Up @@ -95,7 +95,7 @@ Type: `String`
Default: `undefined`

Glob or path from where we сopy files.
Globs accept [minimatch options](https://github.com/isaacs/minimatch).
Globs accept [micromatch options](https://github.com/micromatch/micromatch).

> ⚠️ Don't use directly `\\` in `from` (i.e `path\to\file.ext`) option because on UNIX the backslash is a valid character inside a path component, i.e., it's not a separator.
> On Windows, the forward slash and the backward slash are both separators.
Expand All @@ -122,6 +122,27 @@ module.exports = {
};
```

##### `For windows`

If you define `from` as file path or folder path on `Windows`, you can use windows path segment (`\\`)

```
...
from: path.resolve('__dirname', 'file.txt'),
...
```

But you should always use forward-slashes in `glob` expressions
See [fast-glob manual](https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows).

```
...
const FIXTURES_DIR_NORMALIZED = path.resolve(__dirname, 'fixtures').replace(/\\/g, '/');
from: path.posix.join(FIXTURES_DIR_NORMALIZED, 'file.txt'),
...
```

#### `to`

Type: `String`
Expand Down
144 changes: 68 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Expand Up @@ -43,9 +43,8 @@
"dependencies": {
"cacache": "^15.0.0",
"find-cache-dir": "^3.3.1",
"glob-parent": "^3.1.0",
"globby": "^7.1.1",
"is-glob": "^4.0.1",
"glob-parent": "^5.1.1",
"globby": "^11.0.0",
"loader-utils": "^2.0.0",
"minimatch": "^3.0.4",
"normalize-path": "^3.0.0",
Expand Down

0 comments on commit a728675

Please sign in to comment.