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

Commit

Permalink
remove coffescript wrapper for defines
Browse files Browse the repository at this point in the history
  • Loading branch information
yxmatic committed Apr 10, 2013
1 parent c036453 commit eef97c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/requirejs/rails/rjs_driver.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ var requirejs = require('<%= rjs_path %>'),
//common to all the optimize() calls.
basConfig = <%= JSON.pretty_generate(build_config.reject {|k,v| k == 'modules'}) %>;

basConfig.onBuildWrite = function(id, path, contents) {
if ((/\(function\(\)\{define\(/).test(contents)) {
// Remove Coffeescript wrapper
contents = contents.replace(/\(function\(\)\{(define\(.+?)\}\)\.call\(this\);/, '$1');
}
return contents;
}

// Function used to mix in baseConfig to a new config target
function mix(target) {
for (var prop in basConfig) {
Expand Down

0 comments on commit eef97c6

Please sign in to comment.