Skip to content

Commit

Permalink
Utilising node_modules as assets
Browse files Browse the repository at this point in the history
  • Loading branch information
waridrox committed Jun 25, 2021
1 parent 043df0a commit 9848666
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
12 changes: 6 additions & 6 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//= link capture.js
//= link analyze.js
//= link upload.js
//= link jquery.flot.js
//= link jquery.flot.crosshair.js
//= link jquery.flot.threshold.js
//= link d3.js
//= link nv.d3.js
//= link nv.d3.min.css
//= link flot/jquery.flot.js
//= link flot/jquery.flot.crosshair.js
//= link flot/jquery.flot.threshold.js
//= link d3/d3.js
//= link nvd3/build/nv.d3.js
//= link nvd3/build/nv.d3.min.css
//= link api.js
13 changes: 8 additions & 5 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
//
//= require jquery
//= require jquery_ujs
//= require jquery-steps.js
//= require jquery.steps/dist/jquery-steps.js
//= require bootstrap.min.js
//= require basics.js
//= require api.js
//= require comment.js
//= require moment.js
//= require d3.js
//= require nv.d3.js
//= require spectral-workbench.js
//= require flot/jquery.flot.js
//= require flot/jquery.flot.crosshair.js
//= require flot/jquery.flot.threshold.js
//= require moment/moment.js
//= require d3/d3.js
//= require nvd3/build/nv.d3.js
//= require spectral-workbench/dist/spectral-workbench.js
4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*
*= require bootstrap.min.css
*= require bootstrap-responsive.min.css
*= require nv.d3.min.css
*= require nvd3/build/nv.d3.min.css
*= require style
*= require graph
*= require comment
*= require spectral-workbench
*= require spectral-workbench/dist/spectral-workbench
*= require font-awesome
*
*= require_self
Expand Down
7 changes: 0 additions & 7 deletions app/views/capture/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<%= javascript_include_tag "jquery.flot" %>
<%= javascript_include_tag "jquery.flot.crosshair" %>
<%= javascript_include_tag "jquery.flot.threshold" %>
<%= javascript_include_tag "d3" %>
<%= javascript_include_tag "nv.d3" %>


<script src="https://cdn.temasys.io/adapterjs/0.15.x/adapter.min.js"></script>

<% unless logged_in? %>
Expand Down
8 changes: 0 additions & 8 deletions app/views/capture/index2.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<%= stylesheet_link_tag "new-capture" %>
<%= javascript_include_tag "api" %>
<%= javascript_include_tag "jquery.flot" %>
<%= javascript_include_tag "jquery.flot.crosshair" %>
<%= javascript_include_tag "jquery.flot.threshold" %>
<%= javascript_include_tag "d3" %>
<%= javascript_include_tag "nv.d3" %>
<%= stylesheet_link_tag "nv.d3.min" %>

<link rel="apple-touch-icon" href="//spectralworkbench.org/images/spectral-workbench-256.png">
<link rel="apple-touch-fa-precomposed" href="//spectralworkbench.org/images/spectral-workbench-256.png">
Expand Down Expand Up @@ -364,4 +357,3 @@
});
})
</script>

2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class Application < Rails::Application

# Enable the asset pipeline
config.assets.enabled = true
config.assets.paths << Rails.root.join("app", "assets", "fonts")
config.assets.paths << Rails.root.join("node_modules")
config.assets.paths << Rails.root.join('public/lib')

# pluralization options, but unneccessary due to:
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# Rails.application.config.assets.paths << Emoji.images_path
# Version of your assets, change this if you want to expire all your assets
config.assets.paths << Rails.root.join('public/lib')
config.assets.paths << Rails.root.join("node_modules")
config.assets.paths << Rails.root.join("app", "assets", "fonts")
config.assets.precompile += ['capture.js', 'analyze.js']

# Precompile additional assets.
Expand Down

0 comments on commit 9848666

Please sign in to comment.