-
-
Notifications
You must be signed in to change notification settings - Fork 51
fix(index): fallback to fs
if this.fs
is undefined
#45
Conversation
Fix for undefined `this.fs` when behind thread-loader
compiler
's cached fs
for stats if there, otherwise, fallbackfs
if this.fs
is undefined
Co-Authored-By: jsg2021 <[email protected]>
Co-Authored-By: jsg2021 <[email protected]>
Co-Authored-By: jsg2021 <[email protected]>
src/index.js
Outdated
// this.fs can be undefined | ||
// e.g when using the thread-loader | ||
// fallback to the fs module | ||
const stat = this.fs ? this.fs.stat : fs.stat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix indent and ;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Apply Suggestion
feature is pretty neat. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsg2021 Thx
No problem! :) |
I wrote up a concern in the larger issue: #43 (comment) |
Co-Authored-By: jsg2021 <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #45 +/- ##
=========================================
- Coverage 17.47% 17.3% -0.17%
=========================================
Files 2 2
Lines 103 104 +1
Branches 13 14 +1
=========================================
Hits 18 18
Misses 73 73
- Partials 12 13 +1
Continue to review full report at Codecov.
|
Released in |
Fixes undefined
this.fs
when behind thread-loader