Sha256: 262389cf00bda7f988f33d93789200b58e9518534dfdecbd0f2d1d43a520d907

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

var requirejs = require(<%= rjs_path.to_s.dump %>)
var baseConfig = <%=
cdn_pattern = Regexp.new("\\Ahttps?://")

modifiedHash = build_config.select { |k, _| k != "modules" }
pathsHash = modifiedHash["paths"]
modifiedHash["dir"] = build_dir.to_s
modifiedHash["paths"] = Hash[pathsHash
  .select do |_, v|
    !v.is_a?(Array)
  end.map do |k, v|
    [k, if !cdn_pattern.match(v) then v else "empty:" end]
  end
] if !pathsHash.nil?

JSON.pretty_generate(modifiedHash)
%>;

baseConfig.modules = [
<% build_config["modules"].each do |m| %>
  <%= JSON.pretty_generate(m) %>,
<% end %>
];

requirejs.optimize(baseConfig);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
requirejs-rails-0.9.4 lib/requirejs/rails/rjs_driver.js.erb