toScriptTag = file => {
						const asset = /** @type {Asset} */ (compilation.getAsset(file));
						const hash = createHash("sha512");
						hash.update(asset.source.source());
						const integrity = `sha512-${hash.digest("base64")}`;
						compilation.updateAsset(
							file,
							x => x,
							/**
							 * @param {AssetInfo} assetInfo asset info
							 * @returns {AssetInfo} new asset info
							 */
							assetInfo => ({
								...assetInfo,
								contenthash: Array.isArray(assetInfo.contenthash)
									? [...new Set([...assetInfo.contenthash, integrity])]
									: assetInfo.contenthash
										? [assetInfo.contenthash, integrity]
										: integrity
							})
						);
						return `<script src="${
							publicPath === "auto" ? "" : publicPath
						}${file}" integrity="${integrity}"></script>`;
					}
@param {string} file file
@returns {string} content of script tag