1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/server
Nathaniel Hill 885eee8021 Fix HMR when parent directory starts with '.' (#4589)
@timneutkens 

This simple change seems to work for me:

```
const ignored = [
    '**/.*',
    'node_modules'
]
```

I believe the regex is used here to try and work on windows as well. So, I wasted a bunch of time trying to figure out how to use a regex and/or the `path` module to ignore the parent directories until I noticed the following:

> glob patterns are not filepaths. They are a type of regular language that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine.

this is from the [anymatch](https://github.com/micromatch/anymatch) documentation which is what webpack uses accoring to this:

https://webpack.js.org/configuration/watch/#watchoptions-ignored

I've verified this glob pattern solves the problem in my environment, can someone test and verify that this works on windows?

👍
2018-09-04 17:20:10 +02:00
..
lib Open editor from error-overlay (minor) (#4979) 2018-08-24 16:30:41 +02:00
config.js Replace uuid with nanoid (#4987) 2018-08-23 17:02:47 +02:00
document.js Fixes dynamic chunks preload links, use href instead of src (#5047) 2018-08-28 17:56:48 +02:00
hot-reloader.js Fix HMR when parent directory starts with '.' (#4589) 2018-09-04 17:20:10 +02:00
index.js Provide a way to copy files in exportPathMap (#5089) 2018-09-04 16:01:50 +02:00
next.js Programmatic API (#310) 2016-12-16 12:33:08 -08:00
on-demand-entry-handler.js Compile pages to .next/static directory (#4828) 2018-07-25 13:45:42 +02:00
render.js Make sure that 404's is not cached by CDN:s (#5088) 2018-09-04 14:13:15 +02:00
require.js Clean up references to this.dir and this.dist everywhere (#4535) 2018-06-04 15:45:39 +02:00
router.js Use a latest version of path-to-regexp for path-match (#3655) 2018-02-01 19:54:09 +01:00
utils.js [WIP] Webpack 4, react-error-overlay, react-loadable (#4639) 2018-07-24 11:24:40 +02:00