Closed bhgames closed 8 years ago
Thanks in advance for any help! Trying to move off rails-assets.
Torba doesn't have any notion of a package content structure. You are responsible to provide correct require
to each asset.
For example, if you ls
packaged directory "/Users/arkavon/.torba/angular-efa92258", you'll see that angular.js resides in "angular/lib/angular.js". Therefore, you'd have to either require it this way, or set up an import option.
With "pack --dry" feature it would be easier to verify, until then this is an inconvenient, but one-off, task.
BTW, you don't need name duplication in a npm package (see README): npm package: "angular", version: "1.2.23"
is just fine.
Alright, with some great finagling of choosing the right interior files, I was able to get this to work. Tons of fun. At least I don't have to rely on a third party hosted service like Rails Assets deciding one day they don't want to "do it" anymore. :+1:
Hey guys, here's my setup:
Torbafile:
Here's my js file:
//= require 'linkifyjs'`
Here's contents of my torba home:
This is after running torba pack, of course.
Anyway, the error I get is:
When I change my js file line to be
//= require 'angular-localforage/dist/angular-localForage.js'
instead, it does load, but then I get
on my browser.
In case you may be wondering, my asset paths are printed here:
Boardvitals::Application.config.assets => {:_blocks=>[#<Proc:0x007f923cb139a8@/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.4/lib/sass/rails/railtie.rb:56>], :paths=>["/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/app/assets/fonts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/app/assets/images", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/app/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/app/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/app/assets/templates", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/lib/assets/question_banks", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/lodash-rails-3.10.1/vendor/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-efcddc16bfc0/app/assets/images", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-efcddc16bfc0/app/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-efcddc16bfc0/app/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/coffee-rails-4.1.1/lib/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/formtastic-3.1.3/app/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/bourbon-4.2.6/app/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/bootswatch-rails-3.3.5/vendor/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/angular-rails-templates-0.2.0/vendor/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/jquery-ui-rails-5.0.5/app/assets/images", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/jquery-ui-rails-5.0.5/app/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/jquery-ui-rails-5.0.5/app/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/jquery-turbolinks-2.1.0/vendor/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/turbolinks-2.5.3/lib/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/jquery-rails-4.0.5/vendor/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.6/assets/stylesheets", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.6/assets/javascripts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.6/assets/fonts", "/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/bootstrap-sass-3.3.6/assets/images", "/Users/arkavon/.torba/angular-efa92258", "/Users/arkavon/.torba/angular-ordinal-3a1af313", "/Users/arkavon/.torba/angular-route-1783da5f", "/Users/arkavon/.torba/localforage-1ddb654e", "/Users/arkavon/.torba/angular-localforage-54bc3cb3", "/Users/arkavon/.torba/linkifyjs-1b1525df"], :prefix=>"/assets", :manifest=>nil, :precompile=>[#<Proc:0x007f92391aa298@/Users/arkavon/Documents/apache-tomcat-6.0.26/webapps/boardvitals/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/railtie.rb:60 (lambda)>, /(?:\/|\\|\A)application\.(css|js)$/, "jquery.ui.datepicker.js", "dashboard/*", "es5-shim.js", "angular_dash.js", "dashboard.js", "dashboard.css", "dashboard-2.css", "jquery.js", "jquery_ujs.js", "dashboard/ie.min.css", "dashboard/jquery-1.10.2.min.js", "dashboard/ie9.min.css", /bootstrap\/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$/, "active_admin.css", "active_admin/print.css", "active_admin.js", "angular/lib/angular.min.js.map", "angular/LICENSE", "angular/package.json", "angular/README.md", "angular-ordinal/LICENSE.md", "angular-ordinal/package.json", "angular-ordinal/README.md", "angular-route/angular-route.min.js.map", "angular-route/bower.json", "angular-route/package.json", "angular-route/README.md", "localforage/bower.json", "localforage/CHANGELOG.md", "localforage/component.json", "localforage/config.rb", "localforage/CONTRIBUTING.md", "localforage/examples/index.html", "localforage/examples/no-driver.html", "localforage/examples/require.html", "localforage/examples/websql-foo.html", "localforage/Gemfile", "localforage/Gemfile.lock", "localforage/LICENSE", "localforage/package.json", "localforage/Rakefile", "localforage/README.md", "localforage/s.coffee", "localforage/site/fonts/icomoon.eot", "localforage/site/fonts/icomoon.svg", "localforage/site/fonts/icomoon.ttf", "localforage/site/fonts/icomoon.woff", "localforage/site/images/logo.png", "localforage/site/index.md", "localforage/site/layouts/layout.erb", "localforage/site/README.txt", "localforage/site/stylesheets/icon-font.scss", "localforage/site/stylesheets/print.css.scss", "localforage/site/stylesheets/screen.css.scss", "localforage/site/stylesheets/syntax.css.scss.erb", "localforage/site/stylesheets/variables.scss", "localforage/src/ember-adapter.js.old", "localforage/src/ember-driver.js.old", "localforage/test/photo.jpg", "localforage/test/photo2.jpg", "localforage/test/test.callwhenready.html", "localforage/test/test.component.html", "localforage/test/test.customdriver.html", "localforage/test/test.iframecontents.html", "localforage/test/test.main.html", "localforage/test/test.min.html", "localforage/test/test.nodriver.html", "localforage/test/test.require.html", "localforage/test copy/indexeddb.html", "localforage/test copy/init.coffee", "localforage/test copy/localstorage.html", "localforage/test copy/photo.jpg", "localforage/test copy/server.coffee", "localforage/test copy/test.api.coffee", "localforage/test copy/test.browserify.coffee.old", "localforage/test copy/test.component.coffee", "localforage/test copy/test.component.html", "localforage/test copy/test.config.coffee", "localforage/test copy/test.config.html", "localforage/test copy/test.drivers.coffee", "localforage/test copy/test.errors.coffees", "localforage/test copy/test.html", "localforage/test copy/test.iframe.coffee", "localforage/test copy/test.iframe.html", "localforage/test copy/test.iframesub.html", "localforage/test copy/test.main.html", "localforage/test copy/test.min.html", "localforage/test copy/test.require.html", "localforage/test copy/test.requiremin.html", "localforage/test copy/test.webworker.coffee", "localforage/test copy/test.webworker.html", "localforage/test copy/websql.html", "angular-localforage/bower_components/angular/angular.min.js.gzip", "angular-localforage/bower_components/angular/angular.min.js.map", "angular-localforage/bower_components/angular/package.json", "angular-localforage/bower_components/angular/README.md", "angular-localforage/bower_components/angular-mocks/package.json", "angular-localforage/bower_components/angular-mocks/README.md", "angular-localforage/bower_components/localforage/CHANGELOG.md", "angular-localforage/bower_components/localforage/component.json", "angular-localforage/bower_components/localforage/package.json", "angular-localforage/bower_components/localforage/README.md", "angular-localforage/bower_components/localforage/site/fonts/icomoon.eot", "angular-localforage/bower_components/localforage/site/fonts/icomoon.svg", "angular-localforage/bower_components/localforage/site/fonts/icomoon.ttf", "angular-localforage/bower_components/localforage/site/fonts/icomoon.woff", "angular-localforage/bower_components/localforage/site/images/logo.png", "angular-localforage/bower_components/localforage/site/index.md", "angular-localforage/bower_components/localforage/site/layouts/layout.erb", "angular-localforage/bower_components/localforage/site/README.txt", "angular-localforage/bower_components/localforage/site/stylesheets/icon-font.scss", "angular-localforage/bower_components/localforage/site/stylesheets/print.css.scss", "angular-localforage/bower_components/localforage/site/stylesheets/screen.css.scss", "angular-localforage/bower_components/localforage/site/stylesheets/syntax.css.scss.erb", "angular-localforage/bower_components/localforage/site/stylesheets/variables.scss", "angular-localforage/CHANGELOG.md", "angular-localforage/LICENSE.md", "angular-localforage/package.json", "angular-localforage/README.md", "linkifyjs/CHANGELOG.md", "linkifyjs/CONTRIBUTING.md", "linkifyjs/LICENSE", "linkifyjs/package.json", "linkifyjs/README.md"], :version=>"1.0-ART-f7b148236cf52cae77aef9e4125d004c", :debug=>false, :compile=>true, :digest=>false, :enabled=>true, :initialize_on_precompile=>false, :compress=>false}