Closed nitsujri closed 8 years ago
As a good example of this you can use "intro.js" from rails-assets. When you include this directive in application.js: //= require intro
it will descend into the various directories looking for JavaScript files to include. Unfortunately it looks like it's too greedy and is grabbing files all the files, including CSS.
--- JavaScript, as expected ---
}
else {
// Export for a browser or Rhino.
root._ = _;
}
}.call(this));
/* line 1, /Users/infamouse/.rvm/gems/ruby-2.1.5@test-project/gems/rails-assets-intro.js-1.0.0/app/assets/stylesheets/intro.js/introjs.scss */
.introjs-overlay {
position: absolute;
--- CSS directives! ---
When you use the gems they append their directories to the Rails.application.config.assets.paths
like so:
"/Users/infamouse/.rvm/gems/ruby-2.1.3@test-project/gems/rails-assets-intro.js-1.0.0/app/assets/images",
"/Users/infamouse/.rvm/gems/ruby-2.1.3@test-project/gems/rails-assets-intro.js-1.0.0/app/assets/javascripts",
"/Users/infamouse/.rvm/gems/ruby-2.1.3@test-project/gems/rails-assets-intro.js-1.0.0/app/assets/stylesheets",
"/Users/infamouse/.rvm/gems/ruby-2.1.3@test-project/gems/rails-assets-intro.js-1.0.0/app/assets/templates",
It appears that this but only affects projects that have a directory inside the gem that ends with .js
such as intro.js which has a directory called app/assets/stylesheets/intro.js/
. Every file inside of this directory is included in the sprockets precompiled JavaScript.
If this is still an active issue can you close this one and re-open it at http://github.com/rails/sprockets. Active development has moved to that repo.
If you've got a bug with sprockets 3 please make sure you've tried the latest 3.3.3. If you can confirm this is still an active issue, the fastest way to get it fixed is to create a small example app that reproduces the failure and open an issue in the new repo http://github.com/rails/sprockets.
This issue was moved to rails/sprockets#180
I upgraded sprockets from 2.12.3 to 3.0.1 and a number of js files from rails-assets.org no longer loads (but some do?).
Gemfile
application.js
Error:
I can change my
Gemfile.lock
fromsprockets (3.0.1)
tosprockets (2.12.3)
and it will work just fine again, or I can add the linegem 'sprockets', "~> 2.12.3"
to myGemfile
Thanks for everything that you guys do! I'll be glad to test anyway I can.