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

Commit 4305858

Browse files
authored
Add wrapShim to build_config_whitelist
Allows using wrapShim in the build config See: https://github.com/requirejs/r.js/blob/b8a6982d2923ae8389355edaa50d2b7f8065a01a/build/example.build.js#L68 As of 2.1.11, shimmed dependencies can be wrapped in a define() wrapper to help when intermediate dependencies are AMD have dependencies of their own. The canonical example is a project using Backbone, which depends on jQuery and Underscore. Shimmed dependencies that want Backbone available immediately will not see it in a build, since AMD compatible versions of Backbone will not execute the define() function until dependencies are ready. By wrapping those shimmed dependencies, this can be avoided, but it could introduce other errors if those shimmed dependencies use the global scope in weird ways, so it is not the default behavior to wrap. More notes in http://requirejs.org/docs/api.html#config-shim
1 parent 0e85479 commit 4305858

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/requirejs/rails/config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def initialize(application)
100100
uglify2
101101
useStrict
102102
wrap
103+
wrapShim
103104
}
104105
end
105106

0 commit comments

Comments
 (0)