@@ -42,10 +42,10 @@ class EleventyDevServer {
42
42
}
43
43
44
44
constructor ( name , dir , options = { } ) {
45
- debug ( "Creating new Dev Server instance." )
45
+ debug ( "Creating new Dev Server instance." ) ;
46
46
this . name = name ;
47
47
this . normalizeOptions ( options ) ;
48
-
48
+
49
49
this . fileCache = { } ;
50
50
// Directory to serve
51
51
if ( ! dir ) {
@@ -85,10 +85,10 @@ class EleventyDevServer {
85
85
// TODO if using Eleventy and `watch` option includes output folder (_site) this will trigger two update events!
86
86
this . _watcher = chokidar . watch ( this . options . watch , {
87
87
// TODO allow chokidar configuration extensions (or re-use the ones in Eleventy)
88
-
88
+
89
89
ignored : [ "**/node_modules/**" , ".git" ] ,
90
90
ignoreInitial : true ,
91
-
91
+
92
92
// same values as Eleventy
93
93
awaitWriteFinish : {
94
94
stabilityThreshold : 150 ,
@@ -100,7 +100,7 @@ class EleventyDevServer {
100
100
this . logger . log ( `File changed: ${ path } (skips build)` ) ;
101
101
this . reloadFiles ( [ path ] ) ;
102
102
} ) ;
103
-
103
+
104
104
this . _watcher . on ( "add" , ( path ) => {
105
105
this . logger . log ( `File added: ${ path } (skips build)` ) ;
106
106
this . reloadFiles ( [ path ] ) ;
@@ -456,19 +456,19 @@ class EleventyDevServer {
456
456
if ( ! res . _shouldForceEnd ) {
457
457
let match = this . mapUrlToFilePath ( req . url ) ;
458
458
debug ( req . url , match ) ;
459
-
459
+
460
460
if ( match ) {
461
461
if ( match . statusCode === 200 && match . filepath ) {
462
462
return this . renderFile ( match . filepath , res ) ;
463
463
}
464
-
464
+
465
465
// Redirects, usually for trailing slash to .html stuff
466
466
if ( match . url ) {
467
467
res . statusCode = match . statusCode ;
468
468
res . setHeader ( "Location" , match . url ) ;
469
469
return res . end ( ) ;
470
470
}
471
-
471
+
472
472
let raw404Path = this . getOutputDirFilePath ( "404.html" ) ;
473
473
if ( match . statusCode === 404 && this . isOutputFilePathExists ( raw404Path ) ) {
474
474
res . statusCode = match . statusCode ;
0 commit comments