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

Commit 03c1bb9

Browse files
committed
Fix a corner case where modules could appear in the build config's paths (this time for good)
1 parent 6023114 commit 03c1bb9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
requirejs-rails (0.9.7)
4+
requirejs-rails (0.9.8)
55
railties (>= 3.1.1)
66

77
GEM

lib/tasks/requirejs-rails_tasks.rake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ OS X Homebrew users can use 'brew install node'.
148148
requirejs.config.build_config["modules"].each do |m|
149149
module_name = requirejs.config.module_name_for(m)
150150
paths = requirejs.config.build_config["paths"] || {}
151+
module_script_name = Pathname.new(module_name).sub_ext(".js").to_s
151152

152153
# Is there a `paths` entry for the module?
153154
if !paths[module_name]
154-
asset_name = Pathname.new(module_name).sub_ext(".js").to_s
155+
asset_name = module_script_name
155156
else
156157
asset_name = Pathname.new(paths[module_name]).sub_ext(".js").to_s
157158
end
@@ -165,7 +166,7 @@ OS X Homebrew users can use 'brew install node'.
165166
# Ensure that the parent directory `a/b` for modules with names like `a/b/c` exist.
166167
digest_asset_path.dirname.mkpath
167168

168-
requirejs.manifest[asset_name] = digest_name
169+
requirejs.manifest[module_script_name] = digest_name
169170
FileUtils.cp built_asset_path, digest_asset_path
170171

171172
# Create the compressed versions

0 commit comments

Comments
 (0)