Updated: Unpoly: Loading large libraries on-demand
Rails asset pipeline
As in newer Rails all assets are precompiled and the path above
/huge-lib.js will at least not exist in production. Here is our preferred way to solve this:
1. Copy the large library to your vendor folder e.g.
2. Create a new file e.g.
//= require huge-lib.js
3. Allow this file to be precompiled by adding the following line to your
config.assets.precompile += ['huge-lib.js']
4. Finally change the compiler from e.g.
map.js.erb and use the