MCPcopy
hub / github.com/webpack/webpack / getAsset

Method getAsset

lib/Compilation.js:5487–5494  ·  view source on GitHub ↗

* Returns the asset or undefined when not found. * @param {string} name the name of the asset * @returns {Readonly<Asset> | undefined} the asset or undefined when not found

(name)

Source from the content-addressed store, hash-verified

5485 * @returns {Readonly<Asset> | undefined} the asset or undefined when not found
5486 */
5487 getAsset(name) {
5488 if (!Object.prototype.hasOwnProperty.call(this.assets, name)) return;
5489 return {
5490 name,
5491 source: this.assets[name],
5492 info: this.assetsInfo.get(name) || EMPTY_ASSET_INFO
5493 };
5494 }
5495
5496 clearAssets() {
5497 for (const chunk of this.chunks) {

Callers 12

applyMethod · 0.80
handleFileMethod · 0.80
getEntrypointSizeMethod · 0.80
fileFilterMethod · 0.80
toAssetFunction · 0.80
webpack.config.jsFile · 0.80
webpack.config.jsFile · 0.80
webpack.config.jsFile · 0.80
webpack.config.jsFile · 0.80
toScriptTagMethod · 0.80
applyMethod · 0.80

Calls 2

callMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected