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

Commit 70a93e1

Browse files
committed
Workaround/fix for build config not containing user config data
1 parent dd10bdb commit 70a93e1

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

lib/requirejs/rails/config.rb

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def initialize(application)
8888
uglify
8989
uglify2
9090
useStrict
91-
wrap
91+
wrapShim
9292
}
9393
end
9494

@@ -100,23 +100,21 @@ def loader=(sym)
100100
end
101101

102102
def build_config
103-
unless self.has_key?(:build_config)
104-
self[:build_config] = self.run_config.merge "baseUrl" => source_dir.to_s,
105-
"modules" => [{'name' => 'application'}]
106-
self[:build_config].merge!(self.user_config).slice!(*self.build_config_whitelist)
107-
case self.loader
108-
when :requirejs
109-
# nothing to do
110-
when :almond
111-
mods = self[:build_config]['modules']
112-
unless mods.length == 1
113-
raise Requirejs::ConfigError, "Almond build requires exactly one module, config has #{mods.length}."
114-
end
115-
mod = mods[0]
116-
name = mod['name']
117-
mod['name'] = 'almond'
118-
mod['include'] = name
119-
end
103+
self[:build_config] = self.run_config.merge "baseUrl" => source_dir.to_s,
104+
"modules" => [{'name' => 'application'}]
105+
self[:build_config].merge!(self.user_config).slice!(*self.build_config_whitelist)
106+
case self.loader
107+
when :requirejs
108+
# nothing to do
109+
when :almond
110+
mods = self[:build_config]['modules']
111+
unless mods.length == 1
112+
raise Requirejs::ConfigError, "Almond build requires exactly one module, config has #{mods.length}."
113+
end
114+
mod = mods[0]
115+
name = mod['name']
116+
mod['name'] = 'almond'
117+
mod['include'] = name
120118
end
121119
self[:build_config]
122120
end

0 commit comments

Comments
 (0)