Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Config paths for modules are not used in the digestify_and_compress task. #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/tasks/requirejs-rails_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,14 @@ OS X Homebrew users can use 'brew install node'.
task digestify_and_compress: ["requirejs:setup"] do
requirejs.config.build_config['modules'].each do |m|
asset_name = "#{requirejs.config.module_name_for(m)}.js"
built_asset_path = requirejs.config.build_dir.join(asset_name)
asset_path_name = requirejs.config[:user_config]['paths'][requirejs.config.module_name_for(m)]

built_asset_path = if asset_path_name
requirejs.config.build_dir.join("#{asset_path_name}.js")
else
requirejs.config.build_dir.join(asset_name)
end

digest_name = asset_name.sub(/\.(\w+)$/) { |ext| "-#{requirejs.builder.digest_for(built_asset_path)}#{ext}" }
digest_asset_path = requirejs.config.target_dir + digest_name

Expand Down