MCPcopy
hub / github.com/webpack/webpack / createResolveDependenciesFromContextMap

Function createResolveDependenciesFromContextMap

lib/ContextReplacementPlugin.js:216–232  ·  view source on GitHub ↗
(createContextMap)

Source from the content-addressed store, hash-verified

214 */
215const createResolveDependenciesFromContextMap =
216 (createContextMap) => (fs, options, callback) => {
217 createContextMap(fs, (err, map) => {
218 if (err) return callback(err);
219 const dependencies = Object.keys(map).map(
220 (key) =>
221 new ContextElementDependency(
222 map[key] + options.resourceQuery + options.resourceFragment,
223 key,
224 options.typePrefix,
225 /** @type {string} */
226 (options.category),
227 options.referencedExports
228 )
229 );
230 callback(null, dependencies);
231 });
232 };
233
234module.exports = ContextReplacementPlugin;

Callers 1

applyMethod · 0.85

Calls 2

keysMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected