How do I add minified JS files to the Rails Webpacker
I am trying to add min.js files - and getting an error.
This works while adding a normal .js file:
- app/javascript/packs/calendar.js
alert('Calendar loaded')
-# app/views/calendars/index.html.erb
Calendar
<%= javascript_pack_tag 'calendar' %>
The above code works. But when I try to add a min.js file it gives an error.
-# app/views/calendars/index.html.erb
Calendar
<%= javascript_pack_tag 'calendar' %>
<%= javascript_pack_tag 'something.min' %>
Can anyone share what the process is for adding min.js files to view via Rails Webpacker?
Thanks
Arjun
I made a stupid mistake!
Can call minified JS files also with the same way.
So, instead of '<%= javascript_pack_tag 'something.min' %>' like I did before - I just have to use '<%= javascript_pack_tag 'something' %>' - and it runs.