We are developing a solution for an intranet application which runs on chromium embedded framework and mobile devices (ios)
We have a problem with high loading times. One part of that problem is that our application.js
is over 1MB
(minified) so we are considering to reduce the size of this file by splitting it up into several versions of the file,
so that each site can call an optimized form of the application.js
only containing the parts of the js it requires.
e.g. we are using ckeditor
on some of the pages - so the assets for ckeditor
should be delivered only if they are required.
My question is how to configure the assets pipeline to produce multiple versions of application.js
Our Setup: jruby, rails, puma
You can create other js manifests in the same format, and make these precompiled in config/application.rb
:
config.assets.precompile << 'some_other_application.js'
Include in views the same way.