Questions tagged [requirejs-rails]

8 questions
5
votes
2 answers

In tests: Make sure all JS is loaded with requirejs

I'm having some problems with our feature specs. I currently suspect requirejs to be the evildoer. It seems that our specs (Rails with capybara-webkit) start running before all JavaScript files are loaded. Capybara-webkit allows me to evaluate…
iGEL
  • 13,729
  • 9
  • 53
  • 65
3
votes
1 answer

RequireJS - Package backbone-related modules for re-use in other Rails/JS applications

I am building a web application based on Rails and, on the client-side Backbone.js. For structuring my Coffeescript-Code, I used RequireJS and requirejs-rails. Each of my Backbone classes lives in its own RequireJS module. I recently refactored a…
2
votes
2 answers

Jasmine, RequireJS and Rails

I'm starting to make the move over to requireJS for a project I'm building. I'm currently using jasminerice, rails 3.2 and the require-rails gem. I've tried to implement…
DJ Forth
  • 1,488
  • 1
  • 17
  • 25
1
vote
0 answers

Javascript errors appearing after r.js build

I'm trying to deploy a rather large project at the moment, and I'm running into some weird js issues in production. In development, everything works perfectly fine. After precompiling my assets (the javascript is compiled with r.js by means of the…
0
votes
1 answer

Requirejs-rails only working in debug mode

I have created a small project with rails and added the requirejs-rails gem. I have set it up as required and while running assets:precompile, it fails when requirejs-rails tries to compile the javascript resources. However, oddly enough, the…
Whyves
  • 411
  • 5
  • 12
0
votes
1 answer

Requirejs optimizer. Exclude all dependencies

I'm using requireJS in Rails application with requirejs-rails gem. What I'm trying to achieve is to create several bundles which contain common code. For example libs_a, libs_b, libs_c, ... Then for some pages of the application create own bundles…
0
votes
1 answer

all modules in define() are undefined

I use requirejs-rails to manage dependencies between client-side modules in my Rails 4 project. my entry point is: (function (define, undefined) { 'use strict'; var mainModule = function(angular, routingConfiguration, controllers) { var…
Andrew Kovalenko
  • 4,873
  • 2
  • 24
  • 40
0
votes
1 answer

requirejs-rails AMD error "two many anonymous modules in it"

Attempting to precompile my Backbone assets using requirejs-rails (using Rails 4). I keep hitting a roadblock that require-js complains that Error: Error: application.js has two many anonymous modules in it. This appears to be a RequireJS error.…
ejvaudio
  • 93
  • 1
  • 6