Sha256: e651d8970ccbd15266723fbdd002e418ddd6f44fb3ddbbfbfd168afc84e28f6a
Contents?: true
Size: 735 Bytes
Versions: 5
Compression:
Stored size: 735 Bytes
Contents
# Frozen-string-literal: true # Copyright: 2012 - 2018 - MIT License # Encoding: utf-8 require "sprockets" module Jekyll module Assets module Plugins Hook.register :asset, :after_compression, priority: 3 do |i, o, t| next unless t == "application/javascript" env = i[:environment] asset = env.find_asset!(i[:filename], pipeline: :source) path = asset.filename.sub(env.jekyll.in_source_dir + "/", "") url = SrcMap.map_path(asset: asset, env: env) url = env.prefix_url(url) o.update({ data: <<~TXT #{o[:data].strip} //# sourceMappingURL=#{url} //# sourceURL=#{path} TXT }) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems