MCPcopy
hub / github.com/webpack/webpack / getSource

Method getSource

lib/ContextModule.js:1354–1366  ·  view source on GitHub ↗

* @param {string} sourceString source content * @param {Compilation=} compilation the compilation * @returns {Source} generated source

(sourceString, compilation)

Source from the content-addressed store, hash-verified

1352 * @returns {Source} generated source
1353 */
1354 getSource(sourceString, compilation) {
1355 if (this.useSourceMap || this.useSimpleSourceMap) {
1356 return new OriginalSource(
1357 sourceString,
1358 `webpack://${makePathsRelative(
1359 (compilation && compilation.compiler.context) || "",
1360 this.identifier(),
1361 compilation && compilation.compiler.root
1362 )}`
1363 );
1364 }
1365 return new RawSource(sourceString);
1366 }
1367
1368 /**
1369 * Generates code and runtime requirements for this module.

Callers 5

codeGenerationMethod · 0.95
renderRuntimeModulesMethod · 0.45
addModulesMethod · 0.45
applyMethod · 0.45
renderModuleMethod · 0.45

Calls 1

identifierMethod · 0.95

Tested by

no test coverage detected