Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
require
instead of requireFromString
.
Although there's some niceness in using the string data straight from the filesystem, you lose the ability to use anything that hooks into the native `require` call – namely `babel` and friends. By using vanilla `require` it becomes possible to use ES6 files for your configuration (or indeed anything else that hooks into standard node module loading machinery). Performance-wise the change should be negligible, given the filesystem/stat cache will be hot from having just loaded the contents of the file.
- Loading branch information
1 parent
833385b
commit e210a0c
Showing
5 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
module.exports = function (path) { | ||
var obj = require(path); | ||
return obj && obj.__esModule ? obj['default'] : obj; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters