diff options
Diffstat (limited to 'node_modules/enhanced-resolve/lib/createInnerContext.js')
-rw-r--r-- | node_modules/enhanced-resolve/lib/createInnerContext.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/node_modules/enhanced-resolve/lib/createInnerContext.js b/node_modules/enhanced-resolve/lib/createInnerContext.js new file mode 100644 index 0000000..1cbd86f --- /dev/null +++ b/node_modules/enhanced-resolve/lib/createInnerContext.js @@ -0,0 +1,36 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +module.exports = function createInnerContext( + options, + message, + messageOptional +) { + let messageReported = false; + let innerLog = undefined; + if (options.log) { + if (message) { + innerLog = msg => { + if (!messageReported) { + options.log(message); + messageReported = true; + } + options.log(" " + msg); + }; + } else { + innerLog = options.log; + } + } + const childContext = { + log: innerLog, + fileDependencies: options.fileDependencies, + contextDependencies: options.contextDependencies, + missingDependencies: options.missingDependencies, + stack: options.stack + }; + return childContext; +}; |