MCPcopy
hub / github.com/webpack/webpack / getAssetPathWithInfo

Method getAssetPathWithInfo

lib/Compilation.js:5762–5771  ·  view source on GitHub ↗

* Gets asset path with info. * @template {PathData} [T=PathData] * @param {string | import("./TemplatedPathPlugin").TemplatePathFn<T>} filename used to get asset path with hash * @param {T} data context data * @returns {InterpolatedPathAndAssetInfo} interpolated path and asset info

(filename, data)

Source from the content-addressed store, hash-verified

5760 * @returns {InterpolatedPathAndAssetInfo} interpolated path and asset info
5761 */
5762 getAssetPathWithInfo(filename, data) {
5763 const assetInfo = {};
5764 // TODO webpack 5: refactor assetPath hook to receive { path, info } object
5765 const newPath = this.hooks.assetPath.call(
5766 typeof filename === "function" ? filename(data, assetInfo) : filename,
5767 data,
5768 assetInfo
5769 );
5770 return { path: newPath, info: assetInfo };
5771 }
5772
5773 getWarnings() {
5774 return this.hooks.processWarnings.call(this.warnings);

Callers 2

getPathWithInfoMethod · 0.95
constructorMethod · 0.45

Calls 1

callMethod · 0.45

Tested by

no test coverage detected