Skip to content

Commit

Permalink
no timestamp, better bundle name
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Mar 6, 2024
1 parent f3f095d commit 700d5b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _plugins/jekyll-bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
bundle = resources['resources'].map { |f| File.read(f) }.join("\n")
hash = Digest::MD5.hexdigest(bundle)[0..7]
site.config['javascript_bundles'][name]['hash'] = hash
site.config['javascript_bundles'][name]['path'] = "/assets/js/bundle.#{hash}.js"
site.config['javascript_bundles'][name]['path'] = "/assets/js/bundle.#{name}.#{hash}.js"

Jekyll.logger.info "Analysing JS Bundle #{name} => #{bundle_timestamp} / #{hash}"
end
Expand Down Expand Up @@ -106,7 +106,7 @@ def load_bundle_production(name)
attrs = ""
attrs += " async" if bundle['async']
attrs += " defer" if bundle['defer']
bundle_path = "#{baseurl}#{bundle['path']}?v=#{bundle['timestamp']}"
bundle_path = "#{baseurl}#{bundle['path']}"
"<script #{attrs} src='#{bundle_path}'></script>"
end
end
Expand Down

0 comments on commit 700d5b6

Please sign in to comment.