Reputation: 32763
I would like to have the non-minified version of JavaScript libraries being used in development, and the minified versions used elsewhere.
How would I go about doing this if I'm using Rails assets?
I'm including like this:
application.haml
= javascript_include_tag :application
application.js
//= require jquery/jquery-1.7.2.min.js
//= require jquery/jquery-ui-1.8.20.custom.min.js
... and many more
Upvotes: 1
Views: 354
Reputation: 35360
The better thing to do is use the :debug
option
= javascript_include_tag "application", debug: Rails.env.development?
In debug mode, assets are not minified.
If you're actually maintaining 2 versions of each library (for example, a minified and raw version of jQuery), this is unnecessary. If you want to see the raw jQuery source in your browser's console, you should always use the unminified version of the library in combination with the :debug
option above.
<script>
tagapplication.js
in a single <script>
tag.Upvotes: 2