Sha256: 8cf7c3f220a2d34b53e22e3e9e8dc3fc018d0d2196bc2759a01f29038f64f218
Contents?: true
Size: 784 Bytes
Versions: 14
Compression:
Stored size: 784 Bytes
Contents
# frozen_string_literal: true require "shopify_cli/theme/dev_server/local_assets" module ShopifyCLI module Theme module Extension class DevServer < ShopifyCLI::Theme::DevServer class LocalAssets < ShopifyCLI::Theme::DevServer::LocalAssets TAE_ASSET_REGEX = %r{(http:|https:)?//cdn\.shopify\.com/extensions/.+?/(assets/.+?\.(?:css|js))} private def replace_asset_urls(body) replaced_body = body.join.gsub(TAE_ASSET_REGEX) do |match| path = Regexp.last_match[2] if @target.static_asset_paths.include?(path) "/#{path}" else match end end [replaced_body] end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems