Open jjb opened 9 years ago
What if you try to //= require "intro.js/intro
for JS and *= require "intro.js/introjs
for CSS?
Checkout #37, #110, #144 for example. You have to require fullpath as we don't create aliases for main files.
I am now using the packaged registered as "intro-js" (which points to the same github project) and it works as expected. I need only #= require intro-js
to make it work.
I don't think I am having the problem described in those tickets. Also I think I'm not seeing the behavior described in those tickets. Maybe new features have been added in the meantime?
The discussion in those tickets suggests that the javascript "main" file declaration don't matter when deciding what file to require. But I am observing that they do. For example, the "autosize" project. The main file is jquery.autosize.js. In my application.js I have #= require autosize
. With this, vendor/assets/bower_components/autosize/jquery.autosize.js is successfully required. As far as I can tell, the only way bower-rails could know to do this is via the "main" declaration.
So I think that the behavior described in this ticket (171) is a bug caused by having a period in the package name.
The package "intro.js" has this bower.json:
and installs with a directory named "intro.js".
As normal I put
asset "intro.js"
in my Bowerfile.With either
require intro.js
orrequire intro
in my application.js, I get the error:If I rename the directory from "intro.js" to "intro" and use
require intro
in application.js, it works.I'm totally new to bower and bower-rails but I believe bower-rails is the layer that is at fault here.
Let me know if you would like any more info or if this should be reported elsewhere. Thanks!
(btw, I have
config.assets.paths << Rails.root.join("vendor","assets","bower_components")
in my application.rb, so I typically can do "require packagname" with no path in my application.js)