File tree 7 files changed +1033
-17
lines changed
7 files changed +1033
-17
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = require ( "chokidar" ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " chokidar2" ,
3
+ "version" : " 2.0.0" ,
4
+ "private" : true ,
5
+ "engines" : {
6
+ "node" : " <8.10.0"
7
+ },
8
+ "dependencies" : {
9
+ "chokidar" : " ^2.1.8"
10
+ }
11
+ }
Original file line number Diff line number Diff line change 6
6
7
7
var EventEmitter = require ( "events" ) . EventEmitter ;
8
8
var async = require ( "neo-async" ) ;
9
- var chokidar = require ( "chokidar" ) ;
9
+ var chokidar = require ( "./ chokidar" ) ;
10
10
var fs = require ( "graceful-fs" ) ;
11
11
var path = require ( "path" ) ;
12
12
@@ -357,7 +357,8 @@ DirectoryWatcher.prototype.getTimes = function() {
357
357
358
358
DirectoryWatcher . prototype . close = function ( ) {
359
359
this . initialScan = false ;
360
- this . watcher . close ( ) . catch ( this . onWatcherError . bind ( this ) ) ;
360
+ var p = this . watcher . close ( ) ;
361
+ if ( p && p . catch ) p . catch ( this . onWatcherError . bind ( this ) ) ;
361
362
if ( this . nestedWatching ) {
362
363
Object . keys ( this . directories ) . forEach ( function ( dir ) {
363
364
this . directories [ dir ] . close ( ) ;
Original file line number Diff line number Diff line change
1
+ var v3Err ;
2
+ try {
3
+ module . exports = require ( "chokidar" ) ;
4
+ return ;
5
+ } catch ( e ) {
6
+ v3Err = e ;
7
+ }
8
+
9
+ var v2Err ;
10
+ try {
11
+ module . exports = require ( "chokidar2" ) ;
12
+ return ;
13
+ } catch ( e ) {
14
+ v2Err = e ;
15
+ }
16
+
17
+ throw new Error (
18
+ "No version of chokidar is available. Tried chokidar@2 and chokidar@3.\n" +
19
+ "You could try to manually install any chokidar version.\n" +
20
+ "chokidar@3: " + v3Err + "\n" +
21
+ "chokidar@2: " + v2Err + "\n"
22
+ )
Original file line number Diff line number Diff line change 36
36
"rimraf" : " ^2.6.2" ,
37
37
"should" : " ^8.3.1"
38
38
},
39
- "dependencies " : {
39
+ "optionalDependencies " : {
40
40
"chokidar" : " ^3.3.0" ,
41
+ "chokidar2" : " file:./chokidar2"
42
+ },
43
+ "dependencies" : {
41
44
"graceful-fs" : " ^4.1.2" ,
42
45
"neo-async" : " ^2.5.0"
43
46
},
Original file line number Diff line number Diff line change 4
4
require ( "should" ) ;
5
5
var path = require ( "path" ) ;
6
6
var fs = require ( "fs" ) ;
7
- var chokidar = require ( "chokidar" ) ;
7
+ var chokidar = require ( "../lib/ chokidar" ) ;
8
8
var TestHelper = require ( "./helpers/TestHelper" ) ;
9
9
var Watchpack = require ( "../lib/watchpack" ) ;
10
10
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments